Cannot estimate simple CFA - warning and error

25 views
Skip to first unread message

Lukas Wallrich

unread,
May 30, 2020, 6:01:14 AM5/30/20
to lavaan
Dear group,

I am trying to estimate a simple CFA and get a warning ("all observed variables are exogenous") and an error ("cov(X[[g]], use = "pairwise") : 'x' is empty), neither of which I understand.

Below the code I am using - I would be very grateful for any pointers in the right direction (my actual model has more factors and indicators, but the messages stay the same).

Kind regards,

Lukas

``` r
cfa_model <- ("
  PolSup := DivPol1 + DivPol2 + DivPol3 + DivPol4
  DivValI := DivValInstr1 + DivValInstr2R + DivValInstr3
")

cfa_dat <- tibble::tribble(
  ~DivPol1, ~DivPol2, ~DivPol3, ~DivPol4, ~DivValInstr1, ~DivValInstr2R, ~DivValInstr3, ~DivValInstr4, 
2, 2, 4, 5, 4, 4, 4, 4, 
  6, 6, 6, 7, 6, 2, 5, 6, 
  5, 5, 4, 4, 7, 3, 4, 7, 
  7, 7, 7, 4, 3, 4, 4, 4, 
  2, 2, 3, 4, 5, 4, 2, 4, 
  4, 4, 4, 5, 2, 7, 1, 1, 
  6, 7, 5, 5, 7, 5, 7, 6, 
  5, 4, 7, 4, 6, 5, 7, 6, 
  5, 5, 7, 5, 6, 2, 4, 6, 
  5, 7, 6, 7, 1, 6, 4, 4, 
  4, 4, 4, 4, 4, 1, 5, 5, 
  5, 4, 7, 3, 6, 2, 5, 6, 
  4, 7, 7, 4, 4, 4, 4, 7, 
  4, 4, 4, 5, 4, 1, 5, 7, 
  6, 6, 4, 6, 6, 6, 6, 6
)



require(lavaan)
#> Loading required package: lavaan
#> This is lavaan 0.6-5
#> lavaan is BETA software! Please report any bugs.
fit <- cfa(cfa_model, data = cfa_dat)
#> Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan
#> WARNING: all observed variables are exogenous; model may not be identified
#> Error in stats::cov(X[[g]], use = "pairwise"): 'x' is empty
```

car...@web.de

unread,
May 30, 2020, 6:19:07 AM5/30/20
to lav...@googlegroups.com
":=" defines a new parameter and not the measurement model. The lavaan tutorial is very helpful to learn the syntax: https://lavaan.ugent.be/tutorial/syntax1.html




Am 30.05.20, 12:01 schrieb Lukas Wallrich <lukas.wallrich@gmail.com>:
--
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/0758fbef-c311-492c-b0b0-84c382b5c27e%40googlegroups.com.
-- Diese Nachricht wurde von meinem Android Mobiltelefon mit WEB.DE Mail gesendet.
Am 30.05.20, 12:01 schrieb Lukas Wallrich <lukas.w...@gmail.com>:
--
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/0758fbef-c311-492c-b0b0-84c382b5c27e%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages