Good afternoon Statlist members,
I've been struggling for the past 3 hours with the following problem. I hope you guys have some good advice!
I have to following code:
gen return = rnormal(0.0050, sqrt(0.0017))
gen sigma = return^2
tabstat return sigma, stat(me v) save
Now I would like to do a simple simulation process where I store each time the mean and variance of both variables return and sigma.
program define myreg, rclass
drop_all
set obs 100
gen return =rnormal(0.0050, sqrt(0.0017))
gen sigma =return^2
tabstat return sigma, stat(me v)
..............
.............
............ Some code here to store the mean and variance of both return and sigma variable.
end
simulate mean_return = ...... var_return =...... mean_sigma=....... var_sigma=..... ,reps(100) :myreg
I've tried tabstatmat, return scalars, estpost but nothing seems to work.
Thank you for help!
I've been struggling for the past 3 hours with the following problem. I hope you guys have some good advice!
I have to following code:
gen return = rnormal(0.0050, sqrt(0.0017))
gen sigma = return^2
tabstat return sigma, stat(me v) save
Now I would like to do a simple simulation process where I store each time the mean and variance of both variables return and sigma.
program define myreg, rclass
drop_all
set obs 100
gen return =rnormal(0.0050, sqrt(0.0017))
gen sigma =return^2
tabstat return sigma, stat(me v)
..............
.............
............ Some code here to store the mean and variance of both return and sigma variable.
end
simulate mean_return = ...... var_return =...... mean_sigma=....... var_sigma=..... ,reps(100) :myreg
I've tried tabstatmat, return scalars, estpost but nothing seems to work.
Thank you for help!
Comment