CFA SEM1 4up
CFA SEM1 4up
2 / 67
Overview Overview
3 / 67 4 / 67
Overview Overview Basic EFA ideas
5 / 67 6 / 67
where:
Λp×k = factor pattern (“loadings”)
Φk ×k = matrix of correlations among factors.
Ψ = diagonal matrix of unique variances of observed variables.
Typically, it is initially assumed that factors are uncorrelated (Φ = I, the
This looks like a set of multiple regression models for the xs, but it is not
identity matrix)
testable, because the factors, ξ, are unobserved
Can use an oblique rotation to allow correlated factors
7 / 67 8 / 67
Overview Basic EFA ideas Overview EFA to CFA
ML estimation for the EFA model finds estimates that minimize the
The only true statistical tests in EFA are tests for the number of common difference between the observed covariance matrix, S, and that
reproduced by the model, Σb =ΛbΦbΛ bT + Ψ
factors (when estimated by ML)
b
Requires imposing k 2 restrictions for a unique solution
H0 : k = k0 k0 factors are sufficient Gives a χ2 test for goodness of fit
Ha : k > k0 > k0 factors are necessary b ∼ χ2
(N − 1)Fmin (S, Σ) with df = [(p − k )2 − p − k ]/2
Substantive questions about the nature of factors can only be addressed Joreskog (1969) proposed that a factor hypothesis could be tested by
approximately through factor rotation methods imposing restrictions on the EFA model— fixed elements in Λ, Ψ, usually
Varimax & friends attempt rotation to simple structure 0
Oblique rotation methods allow factors to be correlated Needs more than k 2 restrictions
Procrustes rotation allows rotation to a “target” (hypothesized) loading matrix The ML solution is then found for the remaining free parameters
The χ2 for the restricted solution gives a test for how well the hypothesized
factor structure fits.
9 / 67 10 / 67
11 / 67 12 / 67
Overview CFA to SEM Overview CFA to SEM
Jöreskog (1973) further generalized the ACOVS model to include SEM model for measures of Math Self-Concept and MATH achievement:
structural equation models along with CFA.
Two parts:
Measurement model — How the latent variables are measured in terms of
the observed variables; measurement properties (reliability, validity) of
observed variables. [Traditional factor analysis models]
Structural equation model — Specifies causal relations among observed
and latent variables.
Endogenous variables - determined within the model (y)
Exogenous variables - determined outside the model (x)
This model has:
Measurement models 3 observed indicators in a measurement model for MSC (x)
x = Λx ξ + δ 2 observed indicators in a measurement model for MATH achievement
for observed variables
y = Λy η + (y)
Structural eqn. for latent A structural equation predicting MATH achievement from MSC
variables η = Bη + Γξ + ζ
13 / 67 14 / 67
15 / 67 16 / 67
Overview software Overview software
17 / 67 18 / 67
19 / 67 20 / 67
Overview software Path diagrams
21 / 67 22 / 67
23 / 67 24 / 67
Path diagrams Path analysis
25 / 67 26 / 67
Endogenous variables
Something new: y1 is a dependent variable in the first equation, but a Serves as a dependent variable (outcome) in at least one equation
predictor in the second If a variable has at least one arrow pointing to it, it is endogenous
This cannot be done simultaneously via standard MRA or MMRA models They are determined inside (“en”) the model
In path analysis models they always have error terms
y1 0 0 y1 γ11 ζ1 In the simple mediation model, x is exogenous,
= + x+ or y = By + Γx + ζ
y2 β21 0 y2 γ21 ζ2 and y1 , y2 are endogenous
29 / 67 30 / 67
Path analysis Exogenous and Endogenous Path analysis General path model
31 / 67 32 / 67
Path analysis General path model Path analysis General path model
The general path analysis model Union sentiment: using the sem package
Other parameters pertain to variances and covariances of the exogenous Read the variance-covariance matrix of the variables using readMoments()
variables and the error terms library(sem)
Φq×q (“Phi”)— variance-covariance matrix of the exogenous variables. union <- readMoments(diag=TRUE,
names=c('y1', 'y2', 'y3', 'x1', 'x2'),
Typically, these are all free parameters. text="
For the union sentiment example, Φ is a 2 × 2 matrix: 14.610
-5.250 11.017
-8.057 11.087 31.971
var(x1 ) -0.482 0.677 1.559 1.021
Φ=
cov(x1 , x2 ) var(x2 ) -18.857 17.861 28.250 7.139 215.662
")
Ψp×p (“Psi”)— variance-covariance matrix of the error terms (ζ).
Typically, the error variances are free parameters, but their covariances The model can be specified in different, equivalent notations, but the simplest
are fixed to 0 (models can allow correlated errors) is often linear equations format, with specifyEquations()
For the union sentiment example, Ψ is a 3 × 3 diagonal matrix:
union.mod <- specifyEquations(covs="x1, x2", text="
y1 = gam12*x2
var(ζ1 )
y2 = beta21*y1 + gam22*x2
Ψ= 0 var(ζ2 )
y3 = beta31*y1 + beta32*y2 + gam31*x1
0 0 var(ζ2 ) ")
33 / 67 34 / 67
Path analysis General path model Path analysis General path model
Union sentiment: using the sem package Union sentiment: Goodness-of-fit statistics
Internally, sem expresses the model using “RAM” path notation (same as The summary() method prints a collection of goodness-of-fit statistics:
used by specifyModel()):
opt <- options(fit.indices = c("GFI", "AGFI", "RMSEA", "NNFI",
union.mod "CFI", "AIC", "BIC"))
summary(union.sem)
## Path Parameter
## 1 x2 -> y1 gam12
## 2 y1 -> y2 beta21 ##
## 3 x2 -> y2 gam22 ## Model Chisquare = 1.25 Df = 3 Pr(>Chisq) = 0.741
## 4 y1 -> y3 beta31 ## Goodness-of-fit index = 0.997
## 5 y2 -> y3 beta32 ## Adjusted goodness-of-fit index = 0.986
## 6 x1 -> y3 gam31 ## RMSEA index = 0 90% CI: (NA, 0.0904)
## 7 x1 <-> x1 V[x1] ## Tucker-Lewis NNFI = 1.0311
## 8 x1 <-> x2 C[x1,x2] ## Bentler CFI = 1
## 9 x2 <-> x2 V[x2] ## AIC = 25.3
## 10 y1 <-> y1 V[y1] ## BIC = -14.2
## 11 y2 <-> y2 V[y2] ##
## 12 y3 <-> y3 V[y3] ## ...
##
## R-square for Endogenous Variables
Fit the model using sem(): ## y1 y2 y3
## 0.113 0.230 0.390
union.sem <- sem(union.mod, union, N=173) ##
## ...
35 / 67 36 / 67
Path analysis General path model Path analysis General path model
37 / 67 38 / 67
Σ = Σ(θ)
Σ = Σ(θ)
Fundamental hypothesis of CFA & SEM Fundamental hypothesis of CFA & SEM
Example: Consider the simple linear regression model,
yi = γxi + ζi
If this model is true, then the variance and covariance of (y, x) are This general hypothesis forms the basis for several important ideas in CFA
and SEM
var(yi ) = var(γxi + ζi )
Model identification: How to know if you can find a unique solution?
= γ 2 var(xi ) + var(ζi )
Model estimation: How to fit a model to an observed covariance matrix
cov(yi , xi ) = γvar(xi ) (S)?
The hypothesis Σ = Σ(θ) means that Σ can be expressed in terms of the Goodness-of-fit statistics: How to assess the discrepancy between S
model-implied parameters, γ (regression slope), var(ζ) (error variance) and and Σ(θ)?
var(x):
2 γ
y var(y ) γ var(x) + var(ζ)
Σ = = = Σ var(ζ)
x cov(y , x) var(y ) γvar(x) var(x)
var(x)
41 / 67 42 / 67
47 / 67 48 / 67
Estimation Estimation
How to fit the model to your data? Maximum likelihood estimation is designed to maximize the likelihood
In ordinary regression analysis, the method of least squares is used to (“probability”) of obtaining the observed data (Σ) over all choices of
find values of the parameters (regression slopes) that minimize the sum parameters (θ) in the model
of squared residuals, (yi − ybi )2 .
P
This is fitting the model to the individual observations L = Pr(data | model) = Pr(S | Σθ )
In constrast, SEM methods find parameter estimates that fit the model to
the observed covariance matrix, S. This assumes that the observed data are multivariate normally distributed
They are designed to minimize a function of the residual covariances, ML estimation is equivalent to minimizing the following function:
S − Σθ
If the model is correct, then Σθ = Σ and as N → ∞, S = Σ. FML = log |Σθ | − log |S| + tr(SΣ−1
θ )−p
There is a variety of estimation methods for SEM, but all attempt to choose
the values of parameters in θ to minimize a function F (•) of the difference All SEM software obtains some initial estimates (“start values”) and uses
between S and Σθ an iterative algorithm to minimize FML
49 / 67 50 / 67
51 / 67 52 / 67
Model evaluation chi-square test Model evaluation chi-square test
b used to minimize the discrepancy between S The test statistic, X 2 = (N − 1)Fmin is a function of sample size.
The fitting function F (S, Σ)
and the model estimate Σ b gives a chi-square test of model fit
b = Σ(θ) With large N, trivial discrepancies will give a significant chi-square
If the model is correct, then the minimized value, Fmin , has an asympotic Worse, it tests an unrealistic hypothesis that the model fits perfectly
chi-square distribution, the specified model is exactly correct in all details
any lack-of-fit is due only to sampling error
X 2 = (N − 1)Fmin ∼ χ2df it relies on asymptotic theory (X 2 ∼ χ2 as N → ∞) and an assumption of
multivariate normality
with df = P(P + 1)/2 − t degrees of freedom Another problem is parsimony— a model with additional free parameters
This gives a test of the hypothesis that the model fits the data will always fit better, but smaller models are simpler to interpret
If you fit several nested models, M1 ⊃ M2 ⊃ M3 . . . , chi-square tests for
H0 : Σ = Σ(θ) the difference between models are less affected by these problems
a large (significant) X 2 indicates that the model does not fit the data. ∆X 2 = X 2 (M1 ) − X 2 (M2 ) ∼ χ2 with df = df1 − df2
53 / 67 54 / 67
55 / 67 56 / 67
Model evaluation Other fit indices Model evaluation Other fit indices
for some function f (•) of X 2 and df , and where the “best” model fits perfectly.
57 / 67 58 / 67
59 / 67 60 / 67
Model evaluation Model modification Model evaluation Model modification
x1 gam31 ##
mod.bad <- specifyEquations(covs="x1, x2", text=' y3 ## Model Chisquare = 50.235 Df = 4 Pr(>Chisq) = 3.2251e-10
y1 = gam12*x2 beta31
y2 = beta21*y1 + gam22*x2 ## RMSEA index = 0.25923 90% CI: (0.19808, 0.32556)
y3 = beta31*y1 + gam31*x1
gam12 y1 beta21 ## Tucker-Lewis NNFI = 0.38328
')
x2 y2 ## Bentler CFI = 0.75331
gam22
##
## Normalized Residuals
## Min. 1st Qu. Median Mean 3rd Qu. Max.
Fit the model: ## -0.159 0.000 0.000 0.594 0.330 5.247
##
union.sem.bad <- sem(mod.bad, union, N=173) ## R-square for Endogenous Variables
union.sem.bad ## y1 y2 y3
## 0.1129 0.2295 0.1957
## ##
## Model Chisquare = 50.235 Df = 4 ...
##
## gam12 beta21 gam22 beta31 gam31 V[x1]
## -0.087438 -0.284563 0.057938 -0.509024 1.286631 1.021000
## C[x1,x2] V[x2] V[y1] V[y2] V[y3]
## 7.139000 215.662000 12.961186 8.488216 25.863934
##
## Iterations = 0 61 / 67 62 / 67
Modification indices
Normalized residuals show the differences S − Σ(θ)b as approximate z-scores,
so values outside of ±2 can be considered significantly large. Modification indices provide test statistics for fixed parameters
The statistics estimate the decrease in X 2 if each fixed parameter was
round(normalizedResiduals(union.sem.bad), 3)
allowed to be freely estimated
## y1 y2 y3 x1 x2 These are χ2 (1) values, so values > 4 can be considered “significantly”
## y1 0.000 0.000 0.103 0.477 0.000 large.
## y2 0.000 0.000 5.246 0.330 0.000
## y3 0.103 5.246 -0.054 -0.159 1.454
## x1 0.477 0.330 -0.159 0.000 0.000 modIndices(union.sem.bad)
## x2 0.000 0.000 1.454 0.000 0.000
##
## 5 largest modification indices, A matrix (regression coefficients):
This points to the one very large residual for the y2 -> y3 (or y3 -> ## y3<-y2 y2<-y3 x2<-y3 y3<-x2 y1<-y3
## 42.071 38.217 4.240 3.947 3.763
y2 ) path ##
In this example Union sentiment (y3) is the main outcome, so it would ## 5 largest modification indices, P matrix (variances/covariances):
make sense here to free the y2 -> y3 path ## y3<->y2 y3<->y1 x2<->y3 x1<->y3 x1<->y2
## 38.3362 3.9468 3.9468 3.9468 0.4114
Once again, we see large values associated with the y2 -> y3 path
63 / 67 64 / 67
Model evaluation Model modification Summary
65 / 67 66 / 67
Summary
Summary II
Path diagrams provide a convenient way to portray or visualize a SEM
Direct translation from/to a system of linear equations
Some software (AMOS graphics) allows construction of the model via a path
diagram
Most SEM software provides for output of models and results as path
diagrams
Path analysis models provide a basic introduction to SEM
No latent variables— only observed (“manifest”) ones
Does not allow for errors of measurement in observed variables
exogenous variables (xs)— only predictors in the linear equations
endogenous variables (ys)— a dependent variable in one or more equations
Error terms reflect errors-in-equations— unmodeled predictors, wrong
functional form, etc.
An important question in SEM models is model identification— can the
parameters be uniquely estimated?
Another important question is how to evaluate model fit?
67 / 67