Closed bkeller2 closed 10 months ago
Hi Brian,
Thanks for noticing this!
I'm not sure if you are aware that the object@Data
slot is not a data.frame
or matrix
. It is an internally defined S4-class lavData
object that contains tons of information about the analyzed data, including a copy of the data in the @X
slot. Although not documented in ?lavaan
, I believe lavaan()
does accept this in place of a data.frame
or matrix
. I think the end result is equivalent, but to make sure (and save time by allowing lavaan()
to skip the process of creating a new @Data
slot), I just made it more explicit by using the dedicated slotData=
argument to fix this.
Awesome! Thanks
This fixes a bug where
nullRMSEA
(i.e., used inmoreFitIndices
) relies on the data set in the global environment. If the data set does not exist there, currently, there is a nondescriptive error message. For example, if the model is generated within a function currently, there is an error:Another example is if the
moreFitIndices
is called even within the function:This issue can be problematic when trying to use the function in something like a simulation. The proposed fix forces
nullRMSEA
to use the data set stored in the lavaan object.