Hello,
I have a dataset with the variable "LeadLevels" (continuous numerical variable, cannot be a negative number, 1104 observations). From this column, I would like to select 10 random samples (without replacement during selection), take the mean of these 10 samples, and then repeat many times (let's say 1000 times). I would like the output means saved in a new document.
So far, Monte Carlo simulation appears to be the best choice. However, I am struggling with coding the command portion (select 10 random samples, average, record result).
. simulate mean, LeadLevel, reps(1000) saving(/Users/caitlynbest/Desktop/Stata output.dta, replace): sample 10, count
invalid 'reps'
r(198);
Any assistance is much appreciated.
Thank you,
Caitlyn
Related Posts with Monte Carlo - Simulations: random samples, record means
Heckman - Wooldridge - selection model for for 2SLS estimator - complex contextAssume that we have a stock exchange with 500 listed firms. Every year, the data for one of the exp…
Creating dummiesHey everyone! I have panel data between 2014 and 2018 on multiple socioeconomic and demography facto…
cmp for a multinomial charity choice/hurdle modelHi, I am trying to estimate a model of charitable giving. I have a study where individuals are given…
ML with interval constraintDear All, This is my very first post on Satatlist. If anything is inappropriate, please let me know…
Creating this TableHello all, I am doing an Age-Period-Cohort analysis and was wondering how I can create the follow ta…
Subscribe to:
Post Comments (Atom)
0 Response to Monte Carlo - Simulations: random samples, record means
Post a Comment