Learn R Programming

simsem (version 0.2-8)

popMisfitMACS: Find population misfit by sufficient statistics

Description

Find the value quantifying the amount of population misfit: $F_0$, RMSEA, and SRMR.

Usage

popMisfitMACS(paramM, paramCM, misspecM, misspecCM, dfParam=NULL, fit.measures="all")

Arguments

paramM
The model-implied mean from the real parameters
paramCM
The model-implied covariance matrix from the real parameters
misspecM
The model-implied mean from the real and misspecified parameters
misspecCM
The model-implied covariance matrix from the real and misspecified parameters
dfParam
The degree of freedom of the real model
fit.measures
The names of indices used to calculate population misfit. There are three types of misfit: 1) discrepancy function ("f0"; see popDiscrepancy), 2) root mean squared error of approximation

Value

  • The vector of the misfit indices

Details

The root mean squared error of approximation (RMSEA) is calculated by $$RMSEA = \sqrt{\frac{F_0}{df}}$$ where $F_0$ is the discrepancy value between two means vectors and covariance matrices (see popDiscrepancy) and $df$ is the degree of freedom in the real model. The standardized root mean squared residual can be calculated by $$SRMR = \sqrt{\frac{2\sum_{i} \sum_{j \le i} \left( \frac{s_{ij}}{\sqrt{s_{ii}}\sqrt{s_{jj}}} - \frac{\hat{\sigma}_{ij}}{\sqrt{\hat{\sigma}_{ii}}\sqrt{\hat{\sigma}_{jj}}} \right)}{p(p + 1)}}$$ where $s_{ij}$ is the observed covariance between indicators i and j, $\hat{\sigma}_{ij}$ is the model-implied covariance between indicators i and j, p is the number of indicators.

References

Browne, M. W., & Cudeck, R. (1992). Alternative ways of assessing model fit. Sociological Methods & Research, 21, 230-258.

Examples

Run this code
m1 <- rep(0, 3)
m2 <- c(0.1, -0.1, 0.05)
S1 <- matrix(c(1, 0.6, 0.5, 0.6, 1, 0.4, 0.5, 0.4, 1), 3, 3)
S2 <- matrix(c(1, 0.55, 0.55, 0.55, 1, 0.55, 0.55, 0.55, 1), 3, 3)
popMisfitMACS(m1, S1, m2, S2)

Run the code above in your browser using DataLab