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.
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.