I am running a simulation to compute the frequency of a p_value less than 0.05. My code is as followed:
Code:
scalar sim=100 scalar n=100 local alpha=0.05 forvalues j=1/'=scalar(sim)'{ forvalues i=1/`scalar(n)'{ regress y x1 x2 x3 local t=_b[x1]/_se[x1] local pi=2*ttail(e(df_r),abs(`t') local count=`count'+(`pi'<'alpha') } scalar p=`count'/scalar(n) putexcel set myresults, modify putexcel (A2)=(p) }
Thank you so much.
Lanna
0 Response to Exporting simulation results to Excel file
Post a Comment