Skip to content
Prev 257028 / 398506 Next

Monte Carlo Simulation

I apologize for my last post.  here is the script I forgot to paste!

subject=1:1000
treat=rbinom(1*1000,1,.13)
gender=rbinom(1*1000,1,.5)
eth=runif(1*1000, min=1, max=4)
cogat=rnorm(1*1000, 100, 16)
map=rnorm(1*1000, 200, 9)
growth=0
simtest=data.frame (subject=subject, treat=treat, gender=gender, eth=round(eth,digits=0), cogat=round(cogat,digits=0),map=round(map,digits=0),growth)
simtest<-transform(simtest, growth=rnorm(1000,m=ifelse(treat==0,0.1,0.5),s=0.03))
simtest

Once again the issues are the correlations, the recoding of the categorical variable and the iterations.

Thanks to all who have helped so far!  You are all so smart!

S