Learn R Programming

simsem (version 0.2-8)

popMisfit: Calculate population misfit

Description

Calculate population misfit given the types of object

Usage

popMisfit(param, misspec, dfParam=NULL, fit.measures="all", ...)

Arguments

param
The object represents the actual parameters
misspec
The object represents the misspecified parameters
dfParam
The degree of freedoms of the target model
fit.measures
The type of population misfit measures: "F0", "rmsea", or "srmr". See popMisfitMACS for further details.
...
The additional arguments

Value

  • The value of population misfit

Examples

Run this code
u35 <- simUnif(0.3, 0.5)
u57 <- simUnif(0.5, 0.7)
u1 <- simUnif(-0.1, 0.1)
n31 <- simNorm(0.3, 0.1)

path.BE <- matrix(0, 4, 4)
path.BE[3, 1:2] <- NA
path.BE[4, 3] <- NA
starting.BE <- matrix("", 4, 4)
starting.BE[3, 1:2] <- "u35"
starting.BE[4, 3] <- "u57"
BE <- simMatrix(path.BE, starting.BE)

residual.error <- diag(4)
residual.error[1,2] <- residual.error[2,1] <- NA
RPS <- symMatrix(residual.error, "n31")

ME <- simVector(rep(NA, 4), 0)

Path.Model <- simSetPath(RPS = RPS, BE = BE, ME = ME)

mis.path.BE <- matrix(0, 4, 4)
mis.path.BE[4, 1:2] <- NA
mis.BE <- simMatrix(mis.path.BE, "u1")
Path.Mis.Model <- simMisspecPath(BE = mis.BE, misfitType="rmsea") #, misfitBound=c(0.05, 0.08))

popMisfit(Path.Model, Path.Mis.Model, fit.measures="rmsea")

Run the code above in your browser using DataLab