Outputting wrong estimates
Posted: Wed Oct 16, 2013 5:23 am
Hi
I've got a problem with regards to the below code. When i run it i get wrong (different) estimates compared to my professor and my fellow students. I have a suspicion that there is something wrong with my rndseed. We all have the same version of eviews and I have even tried reinstalling eviews (8) in order to get rid of this problem. Any ideas?
'Problem set 6: EViews code
!n = 10000 'Number of observations in workle
create Problem_set_6 u 1 !n'Create workle
vector (3) ss'Create vector to contain sample sizes
ss.fill 100, 1000, 10000'Fill in sample sizes
rndseed 123456 'Seed the random number generator to reproduce output
matrix (3,2) probitbeta'Dene matrix to contain results
matrix (3,2) logitbeta'Dene matrix to contain results
genr x =100+@sqr(100)*nrnd 'Generate data
smpl 1 !n
genr eps = nrnd 'Generate innovations
genr ystar = -10 + 0.1*x + eps'Calculate ystar
genr y = (ystar>=0)'Calculate y
for !j=1 to 3'Run loop over sample sizes
!ed = ss(!j)'Pick out the relevant sample size
smpl 1 !ed
equation MLprobit.binary(d=n) y c x'Estimate by least squares
probitbeta(!j,1) = c(1)'Save the intercept coecient
probitbeta(!j,2) = c(2)'Save the slope coecient
equation MLlogit.binary(d=l) y c x'Estimate by least squares
logitbeta(!j,1) = c(1)'Save the intercept coecient
logitbeta(!j,2) = c(2)'Save the slope coecient
next
delete ss x eps y MLprobit MLlogit
show probitbeta
show logitbeta
I've got a problem with regards to the below code. When i run it i get wrong (different) estimates compared to my professor and my fellow students. I have a suspicion that there is something wrong with my rndseed. We all have the same version of eviews and I have even tried reinstalling eviews (8) in order to get rid of this problem. Any ideas?
'Problem set 6: EViews code
!n = 10000 'Number of observations in workle
create Problem_set_6 u 1 !n'Create workle
vector (3) ss'Create vector to contain sample sizes
ss.fill 100, 1000, 10000'Fill in sample sizes
rndseed 123456 'Seed the random number generator to reproduce output
matrix (3,2) probitbeta'Dene matrix to contain results
matrix (3,2) logitbeta'Dene matrix to contain results
genr x =100+@sqr(100)*nrnd 'Generate data
smpl 1 !n
genr eps = nrnd 'Generate innovations
genr ystar = -10 + 0.1*x + eps'Calculate ystar
genr y = (ystar>=0)'Calculate y
for !j=1 to 3'Run loop over sample sizes
!ed = ss(!j)'Pick out the relevant sample size
smpl 1 !ed
equation MLprobit.binary(d=n) y c x'Estimate by least squares
probitbeta(!j,1) = c(1)'Save the intercept coecient
probitbeta(!j,2) = c(2)'Save the slope coecient
equation MLlogit.binary(d=l) y c x'Estimate by least squares
logitbeta(!j,1) = c(1)'Save the intercept coecient
logitbeta(!j,2) = c(2)'Save the slope coecient
next
delete ss x eps y MLprobit MLlogit
show probitbeta
show logitbeta