Learn R Programming

pamm (version 0.5)

EAMM: Simulation function for exploratory power analysis for random effects

Description

Given a specific sample size (fixed number of group and replicates per group), the function simulate different variance-covariance structure and assess p-values and power of random intercept and random slope.

Usage

EAMM(numsim, group, repl, fixed = c(0, 1, 0), VI = seq(0.05, 0.95,0.05),
       VS = seq(0.05, 0.5, 0.05), CoIS = 0, relIS = "cor", intercept = 0)

Arguments

numsim
number of simulation for each step
group
number of group (individuals)
repl
number of replicates (observations) per group
fixed
vector of lenght 3 with mean, variance and estimate of fixed effect to simulate. Default: c(0,1,0)
VI
variance component of intercept (ID). Could be specified as a vector. default value: seq(0.05,0.95,0.05)
VS
variance component of slope (ID*fixed effect interaction). Could be specified as a vector. Default: seq(0.05,0.5,0.05))
CoIS
value of correlation or covariance between random intercept and random slope. Default: 0
relIS
"cor" or "cov" set the type of relation give in CoIS. By default the relation is set to correlation
intercept
a numeric value giving the expected intercept value. Default: 0

Value

  • data frame reporting estimated P-values and power with CI for random intercept and random slope

Warning

the simulation is based on a balanced data set with unrelated group

Details

P-values for random effects are estimated using a log-likelihood ratio test between two models with and without the effect. Power represent the percentage of simulations providing a significant p-value for a given random structure. Residual variance (e) is calculted as 1-VI.

References

...

See Also

PAMM, SSF, plot.EAMM

Examples

Run this code
ours=EAMM(numsim=10,group=10,repl=4,fixed=c(0,1,1),VI=seq(0.05,0.3,0.05),
             VS=seq(0.05,0.2,0.05))
  plot(ours, "both")

Run the code above in your browser using DataLab