Hi stata users.
I am having problem with simulate command. I have generated a dataset that has four different size ( n=200,300,400 & 500) after manipulating the data then I run the simulate command but I get this error
“option n() incorrectly specified”. My code is below, essentially I would like to simulate m1 and m2 for the different sample sizes. Any advice greatly appreciated.
Many thanks
* Run program
clear *
set seed 1
capture program drop simanal
for val i=200(100)500{
set obs =`i'
simanal , n(`obs')
return list
* Run full simulation study
simulate n=r(n) mean_1=r(mean_1) mse_1=r(mse_1) mdf_1=r(mdf_1) ///
mean_2=r(mean_2) mse_2=r(mse_2) mdf_2=r(mdf_2)
reps(1000) seed(93334) saving(output, replace):simanal, n(`obs')
}
I am having problem with simulate command. I have generated a dataset that has four different size ( n=200,300,400 & 500) after manipulating the data then I run the simulate command but I get this error
“option n() incorrectly specified”. My code is below, essentially I would like to simulate m1 and m2 for the different sample sizes. Any advice greatly appreciated.
Many thanks
* Run program
clear *
set seed 1
capture program drop simanal
for val i=200(100)500{
set obs =`i'
simanal , n(`obs')
return list
* Run full simulation study
simulate n=r(n) mean_1=r(mean_1) mse_1=r(mse_1) mdf_1=r(mdf_1) ///
mean_2=r(mean_2) mse_2=r(mse_2) mdf_2=r(mdf_2)
reps(1000) seed(93334) saving(output, replace):simanal, n(`obs')
}
Comment