Description Usage Arguments Details Value Warning Author(s) References See Also Examples

Given a specific varaince-covariance structure for random effect, the function simulate different group size and assess p-values and power of random intercept and random slope

1 2 |

`numsim` |
number of simulation for each step |

`group` |
number of group. Could be specified as a vector |

`repl` |
number of replicates per group . Could be specified as a vector |

`randompart` |
vector of lenght 4 or 5, with 1: variance component
of intercept, VI; 2: variance component of slope, VS; 3: residual
variance, VR; 4: relation between random intercept and random
slope; 5: "cor" or "cov" determine if the relation 4 between I ans S is a correlation or a covariance. Default: |

`fixed` |
vector with mean, variance and estimate of fixed effect to simulate. Default: |

`n.X` |
number of different values to simulate for the fixed effect (covariate).
If |

`autocorr.X` |
correlation between two successive covariate value for a group. Default: |

`X.dist` |
specify the distribution of the fixed effect. Only "gaussian" (normal distribution) and
"unif" (uniform distribution) are accepted actually. Default: |

`intercept` |
a numeric value giving the expected intercept value. Default:0 |

`heteroscedasticity` |
a vector specifying heterogeneity in residual variance
across X. If |

`ftype` |
character value "lmer", "lme" or "MCMCglmm" specifying the function to use to fit the model. Actually "lmer" only is accepted |

`mer.sim` |
simulate the data using simulate.merMod from lme4. Faster for large sample size but not as flexible. |

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

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

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

Julien Martin

Martin, Nussey, Wilson and Reale Submitted Measuring between-individual variation in reaction norms in field and experimental studies: a power analysis of random regression models. Methods in Ecology and Evolution.

1 2 3 4 5 6 |

pamm documentation built on May 29, 2017, 8:43 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.