Specify a CFA with some factor loadings negative

590 views
Skip to first unread message

Jared Harpole

unread,
Sep 11, 2014, 3:39:35 PM9/11/14
to lav...@googlegroups.com
Hello,

I am running R version 3.1.1 and lavaan 0.5-16 and have a question about constraining some of the factor loadings in a solution to be negative. Here is an example:

library(lavaan)
HS.model1 <- '  visual =~ *NA*x1 + x2 + x3
              textual =~ NA*x4 + x5 + x6
              speed   =~ NA*x7 + x8 + x9
              visual~~1*visual
              textual~~1*textual
              speed~~1*speed'
fit1 <- cfa(HS.model1,
           data = HolzingerSwineford1939)
summary(fit1)

I summarize the loadings

                   Estimate  Std.err  Z-value  P(>|z|)
Latent variables:
  visual =~
    x1                0.900    0.081   11.127    0.000
    x2                0.498    0.077    6.429    0.000
    x3                0.656    0.074    8.817    0.000
  textual =~
    x4                0.990    0.057   17.474    0.000
    x5                1.102    0.063   17.576    0.000
    x6                0.917    0.054   17.082    0.000
  speed =~
    x7                0.619    0.070    8.903    0.000
    x8                0.731    0.066   11.090    0.000
    x9                0.670    0.065   10.305    0.000



Now I want to specify that x1, x4, and x7 have a negative loadings


###My attempt at the solution
HS.model.neg <- 'visual =~ -1*NA*x1 + x2 + x3
                 textual =~ -1*NA*x4 + x5 + x6
                 speed =~ -1*NA*x7 +  x8 +  x9
                 visual~~1*visual
                 textual~~1*textual
                 speed~~1*speed'
###This does not work
summary of loadings

                   Estimate  Std.err  Z-value  P(>|z|)
Latent variables:
  visual =~
    x1                0.900    0.081   11.127    0.000
    x2                0.498    0.077    6.429    0.000
    x3                0.656    0.074    8.817    0.000
  textual =~
    x4                0.990    0.057   17.474    0.000
    x5                1.102    0.063   17.576    0.000
    x6                0.917    0.054   17.082    0.000
  speed =~
    x7                0.619    0.070    8.903    0.000
    x8                0.731    0.066   11.090    0.000
    x9                0.670    0.065   10.305    0.000

Here is what I want:
x1 should be -0.900
x4 should be -0.990
x7 should be -0.619

Any feedback would be helpful as I can fit this type of thing in Mplus version 7.

Thanks,

Jared

Seongho Bae

unread,
Sep 11, 2014, 3:51:07 PM9/11/14
to lav...@googlegroups.com
That's normal. You have better to try alpha() in psych() package for check they are negatively correlated or have better to try confirmatory full-information item factor analysis by mirt().

Seongho Bae

2014년 9월 12일 금요일 오전 4시 39분 35초 UTC+9, Jared Harpole 님의 말:

Jeremy Miles

unread,
Sep 11, 2014, 4:06:09 PM9/11/14
to lav...@googlegroups.com

Take a look at the section on Nonlinear equality and inequality constraints on this page: http://lavaan.ugent.be/tutorial/syntax2.html , it explains how to do it.

yrosseel

unread,
Sep 11, 2014, 4:36:51 PM9/11/14
to lav...@googlegroups.com
On 09/11/2014 09:39 PM, Jared Harpole wrote:
> HS.model.neg <- 'visual =~ -1*NA*x1 + x2 + x3

You can not use the modifier '*' twice. But you can repeat the rhs
element, each time with a different modifier. So you can write:

visual =~ NA*x1 + x2 + x3 + start(-1)*x1

Now, this will 'free' up the first factor loading, and suggest -1 as a
starting value. But the starting values for the other two indicators
will still be positive (+1). So, if you really want to flip the signs,
you may need two negative starting values:

HS.model.neg <- 'visual =~ NA*x1 + start(-1)*x2 + x3 + start(-1)*x1
textual =~ NA*x4 + start(-1)*x5 + x6 + start(-1)*x4
speed =~ NA*x7 + start(-1)*x8 + x9 + start(-1)*x7
visual~~1*visual
textual~~1*textual
speed~~1*speed'

fit1 <- cfa(HS.model.neg,
data = HolzingerSwineford1939)
summary(fit1)

gives:

Estimate Std.err Z-value P(>|z|)
Latent variables:
visual =~
x1 -0.900 0.081 -11.127 0.000
x2 -0.498 0.077 -6.429 0.000
x3 -0.656 0.074 -8.817 0.000
textual =~
x4 -0.990 0.057 -17.474 0.000
x5 -1.102 0.063 -17.576 0.000
x6 -0.917 0.054 -17.082 0.000
speed =~
x7 -0.619 0.070 -8.903 0.000
x8 -0.731 0.066 -11.090 0.000
x9 -0.670 0.065 -10.305 0.000



Yves.



Reply all
Reply to author
Forward
0 new messages