A function to find the coverage rate of confidence intervals in a model when none, one, or more of the simulations parameters vary randomly across replications.
1 2 
simResult 

coverValue 
A target value used that users wish to find the coverage rate of that value (e.g., 0). If 
contParam 
Vector of parameters names that vary over replications. 
coverParam 
Vector of parameters names that the user wishes to find coverage rate for. This can be a vector of names (e.g., "f1=~y2", "f1~~f2"). If parameters are not specified, coverage rates for all parameters in the model will be returned. 
nVal 
The sample size values that users wish to find power from. 
pmMCARval 
The percent completely missing at random values that users wish to find power from. 
pmMARval 
The percent missing at random values that users wish to find power from. 
paramVal 
A list of varying parameter values that users wish to find power from. 
In this function, the coverage (which can be 0 or 1) is regressed on randomly varying simulation parameters (e.g., sample size, percentage of missing data, or model parameters) using logistic regression. For a set of independent variables values, the predicted probability from the logistic regression equation is the predicted coverage rate.
Data frame containing columns representing values of the randomly varying simulation parameters, and coverage rates for model parameters of interest.
Sunthud Pornprasertmanit (psunthud@gmail.com), Alexander M. Schoemann (East Carolina University; schoemanna@ecu.edu)
SimResult
to see how to create a simResult object with randomly varying parameters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  ## Not run:
loading < matrix(0, 6, 1)
loading[1:6, 1] < NA
LY < bind(loading, 0.7)
RPS < binds(diag(1))
RTE < binds(diag(6))
CFA.Model < model(LY = LY, RPS = RPS, RTE = RTE, modelType="CFA")
# Specify both sample size and percent missing completely at random. Note that more finegrained
# values of n and pmMCAR is needed, e.g., n=seq(50, 500, 1) and pmMCAR=seq(0, 0.2, 0.01)
Output < sim(NULL, model=CFA.Model, n=seq(100, 200, 20), pmMCAR=c(0, 0.1, 0.2))
summary(Output)
# Get the coverage rates of all possible combinations of n and pmMCAR
getCoverage(Output)
# Get the coverage rates of the combinations of n of 100 and 200 and pmMCAR of 0, 0.1, and 0.2
getCoverage(Output, coverValue = 0, nVal=c(100, 200), pmMCARval=c(0, 0.1, 0.2))
## End(Not run)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.