Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

simsem (version 0.2-0)

popDiscrepancy: Find the discrepancy value between two means and covariance matrices

Description

Find the discrepancy value between two means and covariance matrices

Usage

popDiscrepancy(paramM, paramCM, misspecM, misspecCM)

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

Value

  • The discrepancy between two means and covariance matrices

Details

The discrepancy value ($F_0$; Browne & Cudeck, 1992) is calculated by F0=tr(Σ~Σ1)log|Σ~Σ1|p+(μ~μ)Σ1(μ~μ). where $\mu$ is the model-implied mean from the real parameters, $\Sigma$ is the model-implied covariance matrix from the real parameters, $\tilde{\mu}$ is the model-implied mean from the real and misspecified parameters, $\tilde{\Sigma}$ is the model-implied covariance matrix from the real and misspecified parameter, 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)
popDiscrepancy(m1, S1, m2, S2)

Run the code above in your browser using DataLab