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
Creating cohorts- pseudo panel dataHi, I'm using 3 rounds of cross sectional NSSO data and would like to generate a pseudo panel datase…
Adding Back Perfect Predictions to Probit Average Marginal EffectHello! I am running a probit regression in Stata. The dependent variable is binary with 1 for promo…
String variable quarterly timeHello everyone, First of all, I have learned a lot from this forum. However, I could not find the a…
Testing for Endogeneity of Dummy Variables.Hi all, I am conducting some research into impact of the World Cup on the growth rate of host count…
Cohort variableHello! I am using data about households and I am interested in analyzing homeownership and mortgage …
Subscribe to:
Post Comments (Atom)
0 Response to Monte Carlo - Simulations: random samples, record means
Post a Comment