createDatasetsFromList function

Create Dataset List From List of Data Objects

Create Dataset List From List of Data Objects

Convert a list of datasets to a dataset list similar to the ones created by generateAnovaDatasets and generateMixedEffectDatasets.

createDatasetsFromList( datasetList, formula, trueBeta, trueSigma, trueTheta, ... )

Arguments

  • datasetList: list of data objects, usually of type data.frame.
  • formula: formula to fit the model using lmer.
  • trueBeta: scalar or vector with the true values of the fixed effects coefficients. Can be of length one in which case it will be replicated to the required length if needed.
  • trueSigma: scalar with the true value of the error scale.
  • trueTheta: scalar or vector with the true values for the variance component coefficients, not including sigma. Can be of length one in which case it will be replicated to the required length if needed.
  • ...: all additional arguments are added to the returned list.

Returns

list that can be passed to processFit and to any of the fitDatasets functions. Only generateData is implemented, all the other functions return an error if called.

Details

The returned list can be passed to processFit and to any of the fitDatasets functions. Splitting and binding of datasets using splitDatasets and bindDatasets is not supported.

Examples

data(sleepstudy) sleepstudy2 <- sleepstudy sleepstudy2[1, "Reaction"] <- sleepstudy2[1, "Reaction"] + 10 fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy) datasets <- createDatasetsFromList(list(sleepstudy, sleepstudy2), formula = Reaction ~ Days + (Days|Subject), trueBeta = getME(fm1, "beta"), trueSigma = sigma(fm1), trueTheta = getME(fm1, "theta")) fitDatasets_lmer(datasets)

See Also

generateAnovaDatasets and generateMixedEffectDatasets