Learn R Programming

simsem (version 0.2-8)

simMisspecCFA: Set of model misspecification for CFA model.

Description

This function will define model misspecifiction from a defined model. This function is similar to simSetCFA such that the matrices that indicates misspecification will be added as arguments in the function. However, users do not have to add all matrices and vectors in the function. Only element indicating misspecification is added.

Usage

simMisspecCFA(..., conBeforeMis=TRUE, misBeforeFill=TRUE, 
misfitType="rmsea", misfitBound=new("NullVector"), averageNumMisspec=FALSE, 
optMisfit="none", numIter=20)

Arguments

...
Arguments definition is listed in the Details section of simSetCFA. Again, this function does not require to list all required matrices or vectors like the
conBeforeMis
TRUE if users wish to constrain parameters before adding misspecification. FALSE if users wish to constrain parameters after adding misspecification.
misBeforeFill
TRUE if users wish to apply misspecification before applying the auto-completion on the parameters that users have not specified. FALSE if users wish to apply the auto-completion before adding misspecification. This option is hel
misfitType
The type of population misfit used in the misfitBound below. The default is "rmsea". The two other options are "f0" and "srmr". See popMisfitMACS fo
misfitBound
The lower and upper bounds of the population misfit. This option must be a vector with two elements.
averageNumMisspec
If TRUE, the misfit will be divided by the number of free elements in the misspecification object. The default is FALSE.
optMisfit
Use the optimization method to pick the misspecification set. That is, the program will draw a number of misspecification sets. Then, the different sets of misspecification will be compared together. If "min" is specified, the program will pi
numIter
The number of different misspecification sets for comparison in the optimization method.

Value

  • object in SimMisspec that saves model misspecification.

See Also

  • simSetCFAfor matrix definition and how to specify CFA model
  • SimMisspecfor the simResult
  • simMisspecPathfor misspecification model in Path analysis andsimMisspecSEMfor misspecification model in SEM.

Examples

Run this code
n01 <- simNorm(0, 0.1)
error.cor.Mis <- matrix(NA, 6, 6)
diag(error.cor.Mis) <- 1
RTD.Mis <- symMatrix(error.cor.Mis, "n01")
CFA.Model.Mis <- simMisspecCFA(RTD=RTD.Mis)

Run the code above in your browser using DataLab