1
$\begingroup$

Does anyone have ideas why when running a CFA in R I'm getting most of my fit statistics to calculate, but AIC and BIC are both NA?

I load lavaan, SEMplot, SEMtools, and haven; load the file (have tried as .sav and as .csv); define the models; then run the analysis. Here's a sample:

Model1Fit <- cfa(model=Model1, data = dataset, orthogonal = FALSE, test = "Satorra-Bentler", std.lv = TRUE)
summary(Model1Fit, fit.measures=TRUE)
semPaths(Model1Fit)

It also seems to happen without the Satorra-Bentler correction. Everything gets run correctly except this section of output:

Loglikelihood and Information Criteria:

Loglikelihood user model ($H_0$) NA

Loglikelihood unrestricted model ($H_1$) NA

Number of free parameters 27

Akaike (AIC) NA

Bayesian (BIC) NA

Any ideas what's going wrong?

$\endgroup$
1
$\begingroup$

I figured it out! I had previously tried changing all of my variables in my SPSS file to "scaled," but what worked was doing that AND deleting the level labels (1=agree, etc) from each variable. Using varTable(dataset) let me see that my variables were still called "labelled" rather than "numeric" until I deleted those level labels.

$\endgroup$
0
$\begingroup$

Can you please show us your model1 specifications? As well as perhaps a head() call of your dataframe and a bit of that output? This will help us assist you.

Lavaan needs to derive a null model from your specification to get fit statistics from.

Sorry, I know I'm not supposed to ask for more information or clarification in an answer, but I don't have enough rep to post a comment yet!

$\endgroup$
  • $\begingroup$ Thanks for the reply, and sorry I didn't get back to you with the additional info! I figured it out-- posted as answer if you're interested. $\endgroup$ – laurah Feb 28 '19 at 4:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.