lavaan 0.6-9 did not run (perhaps do.fit = FALSE)?

830 views
Skip to first unread message

Maristella Lunardon

unread,
Jul 1, 2021, 1:10:10 AM7/1/21
to lavaan
Hello,
I am new to structural equation modeling and lavaan. 
I am running very simple models to get familiar with it.
I have a problem with a model.
This is the code:

sem_model = 'dvTeco ~ raven_iq + gender
'
model_sem = sem(sem_model, data=ds1)
summary(model_sem)

dvTeco and raven_iq are continuous variable. gender is ordered (0, 1).

This is the output

lavaan 0.6-9 did not run (perhaps do.fit = FALSE)?

** WARNING ** Estimates below are simply the starting values

 

  Estimator                                         ML

  Optimization method                           NLMINB

  Number of model parameters                         3

                                                      

  Number of observations                           113

                                                     

Model Test User Model:

                                                     

  Test statistic                                    NA

  Degrees of freedom                                NA

 

Parameter Estimates:

 

  Standard errors                             Standard

  Information                                 Expected

  Information saturated (h1) model          Structured

 

Regressions:

                   Estimate  Std.Err  z-value  P(>|z|)

  dvTeco ~                                           

    raven_iq          0.000       NA                 

    gender            0.000       NA                 

 

Variances:

                   Estimate  Std.Err  z-value  P(>|z|)

   .dvTeco          796.117       NA

 

If I use another continuous variable instead of raven_iq, it works. So I think the problem is with raven_iq. Why a continuous variable should not work in a model?

Thank you very much!


Pat Malone

unread,
Jul 1, 2021, 9:14:42 AM7/1/21
to lav...@googlegroups.com
Maristella,

What shows up in the output if you just run

sem(sem_model, data=ds1)

Also, as general practice, I recommend

model_sem <- sem(sem_model, data=ds1)

over

model_sem = sem(sem_model, data=ds1)

For assignment statements in R, since '=' hasother purposes.

Pat

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/102fa5db-5db0-492c-9698-7989ff0875adn%40googlegroups.com.


--
Patrick S. Malone, PhD
Sr Research Statistician, FAR HARBΦR
This message may contain confidential information; if you are not the intended recipient please notify the sender and delete the message.

Yves Rosseel

unread,
Jul 2, 2021, 4:36:28 AM7/2/21
to lav...@googlegroups.com
Dear lavaan community,

I am happy to announce that lavaan 0.6-9 has made its way to CRAN.

This release has two important user-visible updates:

1) twolevel modeling now works with missing data (missing = "ml")

2) the sam() function has been made public

The latter implements a 'structural-after-measurement' approach to SEM.
More information about this approach can be found in this paper:

https://osf.io/pekbm/

which will be submitted soon.

Yves.

Terrence Jorgensen

unread,
Jul 8, 2021, 6:10:47 AM7/8/21
to lavaan
gender is ordered (0, 1)

gender is exogenous, it should be represented in your model by a (numeric) dummy code. 


If it is stored as class c("ordered","factor"), that could be a problem.

example(cfa)
HS  <- HolzingerSwineford1939
HS$gender <- ordered(HS$sex)
update(fit, add = 'visual ~ gender', data = HS)

lavaan 0.6-10.1653 did not run (perhaps do.fit = FALSE)?
** WARNING ** Estimates below are simply the starting values

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

Reply all
Reply to author
Forward
0 new messages