getPowerFitNonNested {simsem} | R Documentation |
Find power in rejecting non-nested models based on the differences in fit indices
Description
Find the proportion of the difference in fit indices from one model that does not in the range of sampling distribution from another model (reject that the dataset comes from the second model) or indicates worse fit than a specified cutoff.
Usage
getPowerFitNonNested(dat2Mod1, dat2Mod2, cutoff = NULL, dat1Mod1 = NULL,
dat1Mod2 = NULL, revDirec = FALSE, usedFit = NULL, alpha = 0.05, nVal = NULL,
pmMCARval = NULL, pmMARval = NULL, condCutoff = TRUE, df = 0, onetailed = FALSE)
Arguments
dat2Mod1 |
|
dat2Mod2 |
|
cutoff |
A vector of priori cutoffs for fit indices. The |
dat1Mod1 |
The |
dat1Mod2 |
The |
revDirec |
Reverse the direction of deciding a power by fit indices (e.g., less than –> greater than). The default is to count the proportion of fit indices that indicates lower fit to the model, such as how many RMSEA in the alternative model that is worse than cutoffs. The direction can be reversed by setting as |
usedFit |
The vector of names of fit indices that researchers wish to get powers from. The default is to get powers of all fit indices |
alpha |
The alpha level used to find the cutoff if the |
nVal |
The sample size value that researchers wish to find the power from. This argument is applicable when |
pmMCARval |
The percent missing completely at random value that researchers wish to find the power from. This argument is applicable when |
pmMARval |
The percent missing at random value that researchers wish to find the power from. This argument is applicable when |
condCutoff |
A logical value to use a conditional quantile method (if |
df |
The degree of freedom used in spline method in quantile regression ( |
onetailed |
Derive the cutoff by using one-tailed test if specified as |
Value
List of power given different fit indices.
Author(s)
Sunthud Pornprasertmanit (psunthud@gmail.com)
See Also
-
getCutoffNonNested
to find the cutoffs for non-nested model comparison -
SimResult
to see how to create simResult
Examples
## Not run:
# Model A: Factor 1 on Items 1-3 and Factor 2 on Items 4-8
loading.A <- matrix(0, 8, 2)
loading.A[1:3, 1] <- NA
loading.A[4:8, 2] <- NA
LY.A <- bind(loading.A, 0.7)
latent.cor <- matrix(NA, 2, 2)
diag(latent.cor) <- 1
RPS <- binds(latent.cor, "runif(1, 0.7, 0.9)")
RTE <- binds(diag(8))
CFA.Model.A <- model(LY = LY.A, RPS = RPS, RTE = RTE, modelType="CFA")
# Model B: Factor 1 on Items 1-4 and Factor 2 on Items 5-8
loading.B <- matrix(0, 8, 2)
loading.B[1:4, 1] <- NA
loading.B[5:8, 2] <- NA
LY.B <- bind(loading.B, 0.7)
CFA.Model.B <- model(LY = LY.B, RPS = RPS, RTE = RTE, modelType="CFA")
# The actual number of replications should be greater than 10.
Output.A.A <- sim(10, n=500, model=CFA.Model.A, generate=CFA.Model.A)
Output.A.B <- sim(10, n=500, model=CFA.Model.B, generate=CFA.Model.A)
Output.B.A <- sim(10, n=500, model=CFA.Model.A, generate=CFA.Model.B)
Output.B.B <- sim(10, n=500, model=CFA.Model.B, generate=CFA.Model.B)
# Find the power based on the derived cutoff for both models
getPowerFitNonNested(Output.B.A, Output.B.B, dat1Mod1=Output.A.A, dat1Mod2=Output.A.B)
# Find the power based on the AIC and BIC of 0 (select model B if Output.B.B has lower AIC or BIC)
getPowerFitNonNested(Output.B.A, Output.B.B, cutoff=c(AIC=0, BIC=0))
## End(Not run)