continuousCoverage: Find coverage rate of model parameters when simulations have...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/getPowerCoverage.R

Description

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

Usage

1
2
continuousCoverage(simResult, coverValue = NULL, contN = TRUE, contMCAR = FALSE, 
    contMAR = FALSE, contParam = NULL, coverParam = NULL, pred = NULL)

Arguments

simResult

SimResult that includes at least one randomly varying parameter (e.g. sample size, percent missing, model parameters)

coverValue

A target value used that users wish to find the coverage rate of that value (e.g., 0). If NULL, the parameter values will be used.

contN

Logical indicating if N varies over replications.

contMCAR

Logical indicating if the percentage of missing data that is MCAR varies over replications.

contMAR

Logical indicating if the percentage of missing data that is MAR varies over replications.

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.

pred

A list of varying parameter values that users wish to find statistical power from.

Details

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.

Value

Data frame containing columns representing values of the randomly varying simulation parameters, and coverage rates for model parameters of interest.

Author(s)

Sunthud Pornprasertmanit (psunthud@gmail.com), Alexander M. Schoemann (East Carolina University; schoemanna@ecu.edu)

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
# Specify Sample Size by n
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 continuous sample size and percent missing completely at random. 
# Note that more fine-grained 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, CFA.Model, n=seq(100, 200, 20), pmMCAR=c(0, 0.1, 0.2))
summary(Output)

# Find the coverage rates of all combinations of different sample size and percent MCAR missing
Ccover <- continuousCoverage(Output, contN = TRUE, contMCAR = TRUE)
Ccover

# Find the coverage rates of parameter estimates when sample size is 200 
# and percent MCAR missing is 0.3
Ccover2 <- continuousCoverage(Output, coverValue=0, contN = TRUE, contMCAR = TRUE, 
     pred=list(N = 200, pmMCAR = 0.3))
Ccover2

## End(Not run)

simsem documentation built on May 29, 2017, 10:40 a.m.

Search within the simsem package
Search all R packages, documentation and source code