Page 1 of 1

am i doing something wrong

Posted: Tue Apr 18, 2017 7:01 am
by russellrobins
i generate two sets of random numbers (sample size = 500) and run a regression between them and collect the slope t-stats. I expect 2.5% of the t-stats to be smaller than -1.96 and 2.5% of the t-stats to be greater than 1.96---am I doing something wrong...the results are close (I get 2.5% below -1.96 but the 97.5 percentile is 1.988) -- is this just sampling variation or am I doing something wrong? thanks


--------------
scalar reps

reps = 50000

matrix(reps,1) results

rndseed 123456

for !i=1 to reps

smpl 1 500

genr epsilony{!i}=@nrnd

genr epsilonx{!i}=@nrnd

equation eq{!i}

equation eq{!i}.ls epsilony{!i} c epsilonx{!i}

results(!i,1)=eq{!i}.@tstats(2)

delete epsilony{!i}

delete epsilonx{!i}

delete eq{!i}


next

Re: am i doing something wrong

Posted: Tue Apr 18, 2017 8:28 am
by startz
This probably is just sampling error. The standard deviation for the two-sided rejection rate with 50,000 trials is about 0.001. You might want to up the number of trials considerably.

It might speed up the program some if you reused the variable names, just replacing the contents.