lavtestscore() function

696 views
Skip to first unread message

Ashly Westrick

unread,
Jan 16, 2018, 7:08:43 AM1/16/18
to lavaan

Hello. I am currently doing a multigroup CFA on a quality of life instrument between English and Spanish speakers. I am doing this analysis in R using the lavaan package. I am also new to this type of analysis. I found that measurement invariance is violated between the metric and configural models and would like to investigate which loadings are causing the violations. I came across the lavtestscore() function and was using this however I am unsure how to interpret the output. Below is an example of the output for one of my domains.

 

 

I have read that an epc greater than 0.1 you would consider releasing. Is this correct and how do I interpret these other values (etsepv).

 

Any insight would be helpful.

Terrence Jorgensen

unread,
Jan 17, 2018, 2:09:50 AM1/17/18
to lavaan

I have read that an epc greater than 0.1 you would consider releasing. Is this correct and how do I interpret these other values (etsepv).


"est" is short  for "estimate" (the current estimated value in the fitted model). EPC stands for expected parameter change, and EPV stands for expected parameter value (the sum of "est" and "epc").   So EPV is the best guess at what the value would be if you were to simultaneously free the all of the constraint indicated in the $uni portion of the lavTestScore() output.  This behavior differs from the modindices() function, which makes the simplifying assumptions that (1) you only want to free 1 fixed parameter, and that (2) you only want to know how much that specific parameter would change (from its fixed value) if you freely estimated that specific parameter.

lavTestScore() is much more flexible, at the cost of being simple:
  • By default, it considers all parameter constraints, NOT fixed parameters (unless you fix a parameter by labeling it in your model syntax and specify in the model syntax that it is equal to a particular value)
  • It returns a total test statistic (in the $test portion of the output) for freeing all of those constraints, in addition to test statistics for each individual constraint
  • If requested, it will return expected parameter changes (and values) for all estimated model parameters, assuming ALL constraints were released
The behavior of modindices() can be mimicked by using the add= argument to obtain tests (and EPCs) for if a fixed parameter(s) were freely estimated.  See the ?lavTestScore help page for details and an example. 

You can call lavTestScore() as you already do if you are only interested in those test statistics.  But if you also want to see how much estimated parameters change when only 1 constraint is freed (or the set of constraints associated with one loading across more than 2 groups), then you must use the release= argument to release that/those constraint(s), one (set) at a time.  Then you will see one $uni test statistic at a time (same as you already see all at once), but the EPCs will reflect expectations if only that (set of) constraint(s) were freed.  Here is an example, based on the ?cfa help page:

example(cfa)
## fit a metric-invariance model
fitmg 
<- update(fit, group = "school", group.equal = "loadings")
## save the full parameter table
PT 
<- parTable(fitmg)
## print the part with loadings (to see labels) and constraints (to test)
PT
[PT$op %in% c("=~","=="), ]
## pass the numbers (in the order they appear in the full PT) of the
## 6 constraints you want to test (i.e., 1:6) one at a time to lavTestScore()
lavTestScore
(fitmg, release = 1, epc = TRUE)
lavTestScore
(fitmg, release = 2, epc = TRUE)
...
lavTestScore
(fitmg, release = 6, epc = TRUE)


Note that this also allows you to see how much OTHER model parameters (potentially of greater interest) would change if a loading were unconstrained.  Specifically, constraining loadings allows factor variances to be freely estimated in all but 1 group (unless they already were because you fix the first loading to 1, as in the example above -- but that identification method assumes the first loading per factor IS INVARIANT without testing that assumption, so I recommend fixing factor variances to 1 for identification, then freeing all but one group's once loadings are constrained across groups).  So if you want to see the (expected) impact of a loading-constraint on the estimated factor variance, then look for that EPC in the output as well.  The "EPC-interest" method for model evaluation/respecification was recently proposed by Daniel Oberski in a few papers:




Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
0 new messages