[R-sig-ME] Help needed: Fitting and Simulating multilevel model in R.

Greg Snow 538280 at gmail.com
Sat Jun 30 20:05:11 CEST 2012


The version of the TeachingDemos package that is on R-forge (not the
CRAN version yet) has a function called "simfun" that could be helpful
in setting up the simulation.  You can get the R-forge version with
the command: install.packages("TeachingDemos", repos=
c("http://R-Forge.R-project.org", getOption("repos")))

Look through the help for "simfun" to see how to use it and ideas for
simulating with it.

For doing the analysis you can use the lme4 package (others as well,
but that is one place to start).

On Sat, Jun 30, 2012 at 6:36 AM, Justice Moses K. Aheto
<justiceaheto at yahoo.com> wrote:
> Dear All,
> I am a new R user but currently working on my dissertation which request that I fit multilevel model to a given situation that can be located below and then simulate the fitted model 10000 times.
>
> Set up a simulation model according to the following recipe in R:
> n=number of observation=1000,
> xi~N(0,1), is a predictor.
> Wi~N(0,1), links to birth weight.
> Ni~Poisson(mean=variance=2), number of children per woman.
> Vij~N(0,1), child predictor
> Zij~N(0,1), is an error term.
> Yij(birthweight)=a+bxi+cvij+d(ρwi+(√1-ρ2)zij)
> Where,
> a=3.1, b=0.2, c=0.3, d=0.3, ρ=(0,1)
> Note: use the interval for ρ on 0, 0.01, 0.02, 0.03, …0.99, 1)
> 1)      Fit multilevel model for the above.
> 2)      Calculate the standard errors of the estimates, t-values, p-values and store them.
> 3)      Run this recipe 10000 times in a loop.
> 4)      How many times is p-value<0.05
> 5)      How does this vary according to ρ?
>
> I am available to provide further clarification on the task should you request for.
> Could someone help me in this regards.
> I do appreciate any assistance given me.
> Many thanks in advance.
>
>
> Kind regards.
>
> Justice Moses K. Aheto
> (Chief Executive Officer)
> Statistics & Analytics Consultancy Services Ltd.
> E-mail: justiceaheto at yahoo.com
> Mobile:00447417589148
>         [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com



More information about the R-sig-mixed-models mailing list