Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/plotPowerCoverage.R
Make a plot of confidence interval coverage rates given varying parameters (e.g., sample size, percent missing completely at random, or random parameters in the model)
1 2 |
object |
|
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"). |
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 that users wish to use in the plot. |
contN |
Include the varying sample size in the coverage rate plot if available |
contMCAR |
Include the varying MCAR (missing completely at random percentage) in the coverage rate plot if available |
contMAR |
Include the varying MAR (missing at random percentage) in the coverage rate plot if available |
useContour |
This argument is used when users specify to plot two varying parameters. If |
Predicting whether the confidence interval of each replication covers target value (or parameter) or not by varying parameters using logistic regression (without interaction). Then, plot the logistic curves predicting the probability of significance against the target varying parameters.
Not return any value. This function will plot a graph only.
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.
getCoverage
to obtain a coverage rate given varying parameters values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
loading <- matrix(0, 6, 1)
loading[1:6, 1] <- NA
LY <- bind(loading, 0.4)
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, n=seq(100, 200, 20), pmMCAR=c(0, 0.1, 0.2), model=CFA.Model)
# Plot the power of the first factor loading along the sample size value
plotCoverage(Output, "f1=~y1", contMCAR=FALSE)
plotCoverage(Output, "f1=~y1", coverValue = 0, contMCAR=FALSE)
# Plot the power of the correlation along the sample size and percent missing completely at random
plotCoverage(Output, "f1=~y1")
## End(Not run)
|
Loading required package: lavaan
This is lavaan 0.6-3
lavaan is BETA software! Please report any bugs.
#################################################################
This is simsem 0.5-14
simsem is BETA software! Please report any bugs.
simsem was first developed at the University of Kansas Center for
Research Methods and Data Analysis, under NSF Grant 1053160.
#################################################################
Attaching package: 'simsem'
The following object is masked from 'package:lavaan':
inspect
Progress: 1 / 18
Progress: 2 / 18
Progress: 3 / 18
Progress: 4 / 18
Progress: 5 / 18
Progress: 6 / 18
Progress: 7 / 18
Progress: 8 / 18
Progress: 9 / 18
Progress: 10 / 18
Progress: 11 / 18
Progress: 12 / 18
Progress: 13 / 18
Progress: 14 / 18
Progress: 15 / 18
Progress: 16 / 18
Progress: 17 / 18
Progress: 18 / 18
Warning messages:
1: In lavaan::parameterEstimates(out, standardized = TRUE, boot.ci.type = citype, :
lavaan WARNING: fmi only available if missing = "(fi)ml"
2: In lavaan::parameterEstimates(out, standardized = TRUE, boot.ci.type = citype, :
lavaan WARNING: fmi only available if missing = "(fi)ml"
3: In lavaan::parameterEstimates(out, standardized = TRUE, boot.ci.type = citype, :
lavaan WARNING: fmi only available if missing = "(fi)ml"
4: In lavaan::parameterEstimates(out, standardized = TRUE, boot.ci.type = citype, :
lavaan WARNING: fmi only available if missing = "(fi)ml"
5: In lavaan::parameterEstimates(out, standardized = TRUE, boot.ci.type = citype, :
lavaan WARNING: fmi only available if missing = "(fi)ml"
6: In lavaan::parameterEstimates(out, standardized = TRUE, boot.ci.type = citype, :
lavaan WARNING: fmi only available if missing = "(fi)ml"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.