View source: R/manageDatasets.R
| createDatasetsFromList | R Documentation |
Convert a list of datasets to a dataset list similar to the ones created by
generateAnovaDatasets and
generateMixedEffectDatasets.
createDatasetsFromList(
datasetList,
formula,
trueBeta,
trueSigma,
trueTheta,
...
)
datasetList |
list of data objects, usually of type |
formula |
formula to fit the model using |
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. |
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.
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.
generateAnovaDatasets and
generateMixedEffectDatasets
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.