object: SimResult that saves the analysis results from multiple replications
assurance: The percentile of the resulting confidence interval width. When assurance is 0.50, the median of the widths is provided. See Lai & Kelley (2011) for more details.
nVal: The sample size value that researchers wish to find the confidence interval width from. This argument is applicable for SimResult with varying sample sizes or percent missing across replications
pmMCARval: The percent missing completely at random value that researchers wish to find the confidence interval width from. This argument is applicable for SimResult with varying sample sizes or percent missing across replications
pmMARval: The percent missing at random value that researchers wish to find the confidence interval width from. This argument is applicable for SimResult with varying sample sizes or percent missing across replications
df: The degree of freedom used in spline method in predicting the confidence interval width by the predictors. If df is 0, the spline method will not be applied. This argument is applicable for SimResult with varying sample sizes or percent missing across replications
Returns
The median of confidence interval width or a confidence interval given a degree of assurance
References
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.
## Not run:loading <- matrix(0,6,2)loading[1:3,1]<-NAloading[4:6,2]<-NAloadingValues <- matrix(0,6,2)loadingValues[1:3,1]<-0.7loadingValues[4:6,2]<-0.7LY <- bind(loading, loadingValues)latent.cor <- matrix(NA,2,2)diag(latent.cor)<-1RPS <- binds(latent.cor,0.5)error.cor <- matrix(0,6,6)diag(error.cor)<-1RTE <- 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)# Get the cutoff (critical value) when alpha is 0.05getCIwidth(Output, assurance=0.80)# Finding the cutoff when the sample size is varied. Note that more fine-grained # values of n is needed, e.g., n=seq(50, 500, 1)Output2 <- sim(NULL, model=CFA.Model, n=seq(50,100,10))# Get the fit index cutoff when sample size is 75.getCIwidth(Output2, assurance=0.80, nVal =75)## End(Not run)