Hi all,
I am using the following code to do a bunch of t-tests and output the
results to excel
foreach i in 1 2 3 5 7 9 {
ttest winar`i' if type=="C", by(class)
scalar m1`i'=`r(mu_1)'
scalar m2`i'=`r(mu_2)'
scalar mdiff`i'=(`r(mu_1)'-`r(mu_2)')
scalar t`i'=r(t)
scalar p`i'=r(p)
}
matrix C =
(m11,m12,m13,m15,m17,m19\m21,m22,m23,m25,m27,m29\mdiff1,mdiff2,mdiff3,mdiff5
,mdiff7,mdiff9\t1,t2,t3,t5,t7,t9\p1,p2,p3,p5,p7,p9)
matrix rownames C= PB PS PB-PS t-stats p-val
matrix colnames C= (per1) (per2) (per3) (per4) (per5) (per6)
mat li C
xml_tab C,append
clear all
Each time I run this I get different results. See below ( only the first row
of matrix is shown)
Run1
PB 0.234 0.109 0.027 -0.020 0.006 0.186
Run2.
PB .22601096 .10431468 .02967896 -.00025647 .02184916 .21296798
And so on. Why? Any thoughts
Regards
rajesh
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/