Hi,
PoissonNormal.do
I was taking a stats class in which R is the official or recommended language but I have sticked with Stata. So whenever I have questions, it's a bit tricky to bring them to the prof since she doesn't use stata. Hope I could get some help here. I posted a question below. My problem is that the poisson model with lamda = 10 never converges based on the code i wrote and I am not confident about the normal approximation code either. Please help. Thanks.
Thanks.
Cheng
PoissonNormal.do
I was taking a stats class in which R is the official or recommended language but I have sticked with Stata. So whenever I have questions, it's a bit tricky to bring them to the prof since she doesn't use stata. Hope I could get some help here. I posted a question below. My problem is that the poisson model with lamda = 10 never converges based on the code i wrote and I am not confident about the normal approximation code either. Please help. Thanks.
*i want to compare the Poisson cdf and the normal approx. for lamda = 10
*poisson
clear
set obs 30
gen n = _n -1
gen prob_poisson = exp(-10)*[(10^n)/exp(lnfactorial(n))]
gen cum_prob_poisson = sum(prob_poisson)
list
*reference material source: http://www.biostat-edu.com/files/Sta...s_for_Ch05.pdf
set obs 30
gen z=(n-10.5)/sqrt(10)
gen cum_prob_norm=normal(z)
*Compare the Poisson cdf and the normal approximation for (a) λ = 10,
list
*poisson
clear
set obs 30
gen n = _n -1
gen prob_poisson = exp(-10)*[(10^n)/exp(lnfactorial(n))]
gen cum_prob_poisson = sum(prob_poisson)
list
*reference material source: http://www.biostat-edu.com/files/Sta...s_for_Ch05.pdf
set obs 30
gen z=(n-10.5)/sqrt(10)
gen cum_prob_norm=normal(z)
*Compare the Poisson cdf and the normal approximation for (a) λ = 10,
list
Cheng
Comment