Could inspect() not ignore parameter constraints?

31 views
Skip to first unread message

Paolo Ghisletta

unread,
Sep 16, 2015, 9:47:23 AM9/16/15
to lavaan
hi,

after reading the lavaan tutorial and testing the examples (and extensively so those on multiple groups and measurement invariance, pp.17-26) it appears to me that lavaan's
inspect()
function is not fully equivalent to Mplus'
TECH1
function or to the
Parameter Specifications
portion of a LiSRel output (if anybody is still familiar with that...).

It appears that inspect() disregards equality constraints (as implied on p. 37 of the tutorial and on p. 38 of the reference manual, under the "partable" value for the what argument of the lavInspect(lavobject, what="free") function) : "The non-zero integers represent both the fixed parameters (for example, factor loadings fixed at 1.0), and the free parameters if we ignore any equality constraints. They correspond with all entries (fixed or free) in the parameter table."

Is it possible to obtain that parameter constraints are considered, so that the non-zero integers are repeated for parameters with equality constraints?

Actually, if I may, this option would be extremely useful and precious for checking that one has correctly specified the tested model - as such it may even appear by default on the output.

Thanks and best regards,
paolo

Yves Rosseel

unread,
Sep 17, 2015, 3:19:31 AM9/17/15
to lav...@googlegroups.com
On 09/16/2015 03:47 PM, Paolo Ghisletta wrote:
> It appears that inspect() disregards equality constraints (as implied on
> p. 37 of the tutorial and on p. 38 of the reference manual, under the
> "partable" value for the what argument of the lavInspect(lavobject,
> what="free") function) : "/The non-zero integers represent both the fixed
> parameters (for example, factor loadings fixed at 1.0), and the free
> parameters if we ignore any equality constraints. They correspond with
> all entries (fixed or free) in the parameter table./"

That is correct, as of lavaan 0.5-18. It is a 'side-effect' of the 'big
change' (when it comes to handling equality constraints) that was
introduced in 0.5-18. The rationale behind this change is explained in
this document:

http://lavaan.ugent.be/notes/lavaan_eq_constraints.pdf

> Is it possible to obtain that parameter constraints are considered, so
> that the non-zero integers are repeated for parameters with equality
> constraints?

That was the case in 0.5-17. I liked that very much too. And this system
of 'repeating the parameter number' for those parameters that are
constrained to be equal works really well for simple equality constraint
(eg a == b), but it does not extend to more general constraints (eg a ==
2*b).

> Actually, if I may, this option would be extremely useful and precious
> for checking that one has correctly specified the tested model - as such
> it may even appear by default on the output.

I take it you are only talking about the output of inspect/lavInspect here?

I have considered the idea of showing the constraints (if any) somehow
in the output of inspect(). I will try something and get back.

Yves.

Yves Rosseel

unread,
Jul 18, 2016, 1:23:08 PM7/18/16
to lav...@googlegroups.com
In lavaan dev 0.5-21, we now add a 'constraints' element at the top of
the model matrices list. It shows a table of parameter numbers that are
constrained to be equal.

For example:

library(lavaan)
example(cfa)
fit <- cfa(HS.model, data=HolzingerSwineford1939, group = "school",
group.equal = "loadings")
inspect(fit)

gives the output below.

Yves.



$constraints
lhs op rhs
1 1 == 31
2 2 == 32
3 3 == 33
4 4 == 34
5 5 == 35
6 6 == 36

$lambda
visual textul speed
x1 0 0 0
x2 1 0 0
x3 2 0 0
x4 0 0 0
x5 0 3 0
x6 0 4 0
x7 0 0 0
x8 0 0 5
x9 0 0 6

$theta
x1 x2 x3 x4 x5 x6 x7 x8 x9
x1 7
x2 0 8
x3 0 0 9
x4 0 0 0 10
x5 0 0 0 0 11
x6 0 0 0 0 0 12
x7 0 0 0 0 0 0 13
x8 0 0 0 0 0 0 0 14
x9 0 0 0 0 0 0 0 0 15

$psi
visual textul speed
visual 16
textual 19 17
speed 20 21 18

$nu
intrcp
x1 22
x2 23
x3 24
x4 25
x5 26
x6 27
x7 28
x8 29
x9 30

$alpha
intrcp
visual 0
textual 0
speed 0

$lambda
visual textul speed
x1 0 0 0
x2 31 0 0
x3 32 0 0
x4 0 0 0
x5 0 33 0
x6 0 34 0
x7 0 0 0
x8 0 0 35
x9 0 0 36

$theta
x1 x2 x3 x4 x5 x6 x7 x8 x9
x1 37
x2 0 38
x3 0 0 39
x4 0 0 0 40
x5 0 0 0 0 41
x6 0 0 0 0 0 42
x7 0 0 0 0 0 0 43
x8 0 0 0 0 0 0 0 44
x9 0 0 0 0 0 0 0 0 45

$psi
visual textul speed
visual 46
textual 49 47
speed 50 51 48

$nu
intrcp
x1 52
x2 53
x3 54
x4 55
x5 56
x6 57
x7 58
x8 59
x9 60

$alpha
intrcp
visual 0
textual 0
speed 0
--
Yves Rosseel -- http://www.da.ugent.be
Department of Data Analysis, Ghent University
http://lavaan.org
Reply all
Reply to author
Forward
0 new messages