Description Usage Arguments Value Author(s) References See Also Examples
Plot a confidence interval width of a target parameter
1 | plotCIwidth(object, targetParam, assurance = 0.50, useContour = TRUE)
|
object |
The target ( |
targetParam |
One or more target parameters to be plotted |
assurance |
The percentile of the resulting width. When assurance is 0.50, the median of the widths is provided. See Lai & Kelley (2011) for more details. |
useContour |
If there are two things from varying sample size, varying percent completely at random, or varying percent missing at random, the |
NONE. The plot the confidence interval width is provided.
Sunthud Pornprasertmanit (psunthud@gmail.com)
Lai, K., & Kelley, K. (2011). Accuracy in parameter estimation for targeted effects in structural equation modeling: Sample size planning for narrow confidence intervals. Psychological Methods, 16, 127-148.
SimResult
for simResult that used in this function.
getCIwidth
to get confidence interval widths
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## Not run:
loading <- matrix(0, 6, 2)
loading[1:3, 1] <- NA
loading[4:6, 2] <- NA
loadingValues <- matrix(0, 6, 2)
loadingValues[1:3, 1] <- 0.7
loadingValues[4:6, 2] <- 0.7
LY <- bind(loading, loadingValues)
latent.cor <- matrix(NA, 2, 2)
diag(latent.cor) <- 1
RPS <- binds(latent.cor, 0.5)
error.cor <- matrix(0, 6, 6)
diag(error.cor) <- 1
RTE <- binds(error.cor)
CFA.Model <- model(LY = LY, RPS = RPS, RTE = RTE, modelType="CFA")
# We make the examples running only 5 replications to save time.
# In reality, more replications are needed.
Output <- sim(5, n=200, model=CFA.Model)
# Plot the widths of factor correlation
plotCIwidth(Output, "f1~~f2", assurance = 0.80)
# The example of continous varying sample size. Note that more fine-grained
# values of n is needed, e.g., n=seq(50, 500, 1)
Output2 <- sim(NULL, n=seq(450, 500, 10), model=CFA.Model)
# Plot the widths along sample size value
plotCIwidth(Output2, "f1~~f2", assurance = 0.80)
# 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)
Output3 <- sim(NULL, n=seq(450, 500, 10), pmMCAR=c(0, 0.05, 0.1, 0.15), model=CFA.Model)
# Plot the contours that each contour represents the value of widths at each level
# of sample size and percent missing completely at random
plotCIwidth(Output3, "f1~~f2", assurance = 0.80)
## End(Not run)
|
Loading required package: lavaan
This is lavaan 0.6-7
lavaan is BETA software! Please report any bugs.
#################################################################
This is simsem 0.5-15
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 / 5
Progress: 2 / 5
Progress: 3 / 5
Progress: 4 / 5
Progress: 5 / 5
Progress: 1 / 6
Progress: 2 / 6
Progress: 3 / 6
Progress: 4 / 6
Progress: 5 / 6
Progress: 6 / 6
Loading required namespace: quantreg
Loading required namespace: splines
Progress: 1 / 24
Progress: 2 / 24
Progress: 3 / 24
Progress: 4 / 24
Progress: 5 / 24
Progress: 6 / 24
Progress: 7 / 24
Progress: 8 / 24
Progress: 9 / 24
Progress: 10 / 24
Progress: 11 / 24
Progress: 12 / 24
Progress: 13 / 24
Progress: 14 / 24
Progress: 15 / 24
Progress: 16 / 24
Progress: 17 / 24
Progress: 18 / 24
Progress: 19 / 24
Progress: 20 / 24
Progress: 21 / 24
Progress: 22 / 24
Progress: 23 / 24
Progress: 24 / 24
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.