prepareMixedEffectDataset {robustlmm}R Documentation

Prepare Dataset for Parametric Bootstrap

Description

This function runs lmer and extracts all information needed to generate new datasets using parametric bootstrap later.

Usage

prepareMixedEffectDataset(
  formula,
  data,
  REML = TRUE,
  overrideBeta,
  overrideSigma,
  overrideTheta,
  ...
)

Arguments

formula

passed on to lmer

data

passed on to lmer

REML

passed on to lmer

overrideBeta

use to override beta used to simulate new datasets, by default getME(fm, "beta") where fm is the fitted model returned by lmer.

overrideSigma

use to override sigma used to simulate new datasets, by default getME(fm, "sigma") where fm is the fitted model returned by lmer.

overrideTheta

use to override theta used to simulate new datasets, by default getME(fm, "theta") where fm is the fitted model returned by lmer.

...

all additional arguments are added to the returned list.

Value

List that can be passed to generateMixedEffectDatasets.

data:

the original dataset

X:

the X matrix as returned by getME

Z:

the Z matrix as returned by getME

Lambda:

the Lambda matrix as returned by getME

numberOfFixedEffects:

the number of fixed effects coefficients

numberOfRandomEffects:

the number of random effects

numberOfRows:

number of rows in the generated dataset

trueBeta:

true values used for beta

trueSigma:

true value used for sigma

trueTheta:

true values used for theta

formula:

formula to fit the model using lmer

...:

additional arguments passed via ...

Author(s)

Manuel Koller

Examples

  preparedDataset <- prepareMixedEffectDataset(Reaction ~ Days + (Days|Subject), sleepstudy)
  str(preparedDataset)

[Package robustlmm version 3.3-1 Index]