Learn R Programming

simsem (version 0.2-8)

simMisspecPath: Set of model misspecification for Path analysis model.

Description

This function will define model misspecifiction from a defined model. This function is similar to simSetPath 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

simMisspecPath(..., exo = FALSE, 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 simSetPath. Again, this function does not require to list all required matrices or vectors like the
exo
specify TRUE if users wish to specify both exogenous and endogenous indicators.
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

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

Examples

Run this code
u1 <- simUnif(-0.1, 0.1)
mis.path.GA <- matrix(0, 2, 2)
mis.path.GA[2, 1:2] <- NA
mis.GA <- simMatrix(mis.path.GA, "u1")
Path.Mis.Model <- simMisspecPath(GA = mis.GA, exo=TRUE)

Run the code above in your browser using DataLab