pamlmixed.Rdpower analysis for linear mixed model
The aim of the analysis: n (default) sample size,
power to estimate power
When aim='n', indicates whether to find number of clusters find='k' or number of cases within each cluster find='n' (default).
The model to be analysed with possible options
A named list of the form `list(cluster1=c(n=n1,k=k1))`, where `cluster1` is the name of the clustering variable
in the model, `n1` is the expcted number of cases within each cluster, and `k1` is the expcted number of clusters. if aim=n, `n1` is
used as starting point for sample size. If aim=clusters, `k1` is used as starting point for number of clusters.
A named list of the form `list(varname1=x1,varname2=x2)`, specifying which variable is categorical and the number of levels (x). Any variable in the model not mentioned in `categorical ` is assumed to be numeric.
The model type or family: `linear` (default) for linear mixed model, `logistic` for binomial logistic mixed model.
Residual variance. Ignored for `model_type="logistic"`
Minimal desired power
Type I error rate (significance cut-off or alpha)
The algorithm to use: `mc` (default) for Monte Carlo simulation, `raw` for raw approximation based on Chi-squared (fast but not very accurate)
Number of repetitions for Monte Carlo method
Logical: should parallel computing be used for the Monte Carlo method
the seed for Monte Carlo simulations, default=42.
TRUE (default) run the simulations, otherwise print out the model without results
(Boolean) `getOption("pamlj.messages")` (default). Print out updates of the simulation steps.
Used for internal purposes
of repetitions for Monte Carlo method
A results object containing:
results$intro | a html | ||||
results$extrainfo | a html | ||||
results$issues | a html | ||||
results$initnotes | a html | ||||
results$infotab | a table | ||||
results$powertab | a table | ||||
results$plotnotes | a html |
Tables can be converted to data frames with asDF or as.data.frame. For example:
results$infotab$asDF
as.data.frame(results$infotab)