yrosseel / lavaan

an R package for structural equation modeling and more
http://lavaan.org
429 stars 98 forks source link

cfa function with no data argument #111

Closed doomlab closed 6 years ago

doomlab commented 6 years ago

Hi guys! I learned something new today teaching with lavaan - you can specify a model and no data:

> text.model = 'latent =~ V1 + V2 + V3 + V4'
> text.fit = cfa(text.model)
> summary(text.fit)
lavaan 0.6-2 did not run (perhaps do.fit = FALSE)?
** WARNING ** Estimates below are simply the starting values

Is there a way to provide a warning after the cfa function if the data or sample.cov arguments are not provided?

yrosseel commented 6 years ago

That is by design! So you can provide starting values, and get the model-implied sample statistics. It is also made clear in the summary() output, so I will leave it by that.