Hi, Stata people. I am really sorry to post this again. I am assigning random treatment and then want to run the regression 1000 times. However, now my regression is only running for once..
Please, Please help
set more off
set matsize 800
cap program drop model
set seed 6000
set obs1280
program model, rclass
generate random=uniform()
sort year random
generate post=0
replace post=1 in 1 in 1/29 // for year 2010
replace post=1 in 296/337 // for year 2011
replace post=1 in 578/619 // for year 2012
reg wheat post i.country_id i.year i.country#c.line_time_trend [aw=ypop], cluster( country_id )
return scalar tau_coeff = _b[post]
return scalar tau_se = _se[post]
return scalar r2 = e(r2)
exit
end
simulate coeff=r(coeff) se=r(se) r2=r(r2), reps(1000): model
sum
Related Posts with simulation not working (running only once)
Interpretation of standardized coefficientsI know that we have previously discussed how the use of standardized coefficients may obfuscate resu…
Omitted variables due to collinearity in PPML regressionsDear Statalist, I am trying to run gravity regressions on the impact of FTA's for different sectors…
Testing for uniform distributionThis thread suggests that to test for the sample uniform distribution quantile command can be used. …
Why not significant?Dear All, I was asked why the estimate below (shaded) with t-value -2.04 is not statistically signif…
Create vars with conditions inside a loopHi, I have the next data Id n_lo1 gr1 gr2 gr3 gr4 gr5 gr6 Pri 01 0600 15 30 54 78 96 45 A1 02 0700…
Subscribe to:
Post Comments (Atom)
0 Response to simulation not working (running only once)
Post a Comment