gabriellajg / equaltestMI

This package includes a number of functions for users to examine measurement invariance via equivalence testing along with adjusted RMSEA cutoff values. In particular, a projection-based method is implemented to test the equality of latent factor means across groups without assuming the equality of intercepts.
1 stars 0 forks source link

findInterval() throws error in eqMI.main() #1

Closed ianhussey closed 6 years ago

ianhussey commented 6 years ago

I'm using v0.1.0.

eqMI.main throws the following error with my data:

Error in findInterval(stat.feed$RMESA_t[i], RMESA_cutoffs[i, 1:4]) : 'vec' must be sorted non-decreasingly and not contain NAs

I've used na.omit() to ensure there are no NAs in the data but the error persists. A google tells me that others have comparable issues with their use of findInterval in other packages, but I don't fully understand it.

Minimal working example here: https://www.dropbox.com/sh/x374y24i4e0syw7/AAAW_VQVFwNcUcC0coRpo1iZa?dl=0

gabriellajg commented 6 years ago

Hi ianhussey,

This is a very good question.

The reason you got that error message from findInterval() function is that RMESA_cutoffs contains only NA values with saturated models. Since your model is a one-factor saturated model (df=0), the adjusted RMSEA thresholds cannot be computed for equivalence testing as the calculation involves a term log(df) and log(0) is undefined. This bug was fixed a month ago and you can install the latest version from GitHub:

install.packages("devtools") library(devtools) devtools::install_github("gabriellajg/equaltestMI", force=TRUE) library(equaltestMI)

Also, the command "strict = FALSE" cannot be found in either lavaan or equaltestMI so you may want to remove it:)

You will get a warning message by running eqMI.main: Warning message: In lavaan::lavTestLRT(...) : lavaan WARNING: some models have the same degrees of freedom

and you can ignore it.

ianhussey commented 6 years ago

Very helpful, thank you!

On Mon, 2 Jul 2018 at 01:39 Ge Jiang notifications@github.com wrote:

Hi ianhussey,

This is a very good question.

The reason you got that error message from findInterval() function is that RMESA_cutoffs contains only NA values with saturated models. Since your model is a one-factor saturated model (df=0), the adjusted RMSEA thresholds cannot be computed for equivalence testing as the calculation involves a term log(df) and log(0) is undefined. This bug was fixed a month ago and you can install the latentest version from GitHub:

install.packages("devtools") library(devtools) devtools::install_github("gabriellajg/equaltestMI", force=TRUE) library(equaltestMI)

Also, the command "strict = FALSE" cannot be found in either lavaan or equaltestMI so you may want to remove it:)

You will get a warning message by running eqMI.main: Warning message: In lavaan::lavTestLRT(...) : lavaan WARNING: some models have the same degrees of freedom

and you can ignore it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gabriellajg/equaltestMI/issues/1#issuecomment-401641007, or mute the thread https://github.com/notifications/unsubscribe-auth/AFdhEE82Iuw_pMv9YHL7pOc_3qWeme8Fks5uCV0ogaJpZM4U009q .

-- Ian Hussey Postdoctoral research fellow Department of Experimental-Clinical and Health Psychology Ghent University

researchgate.net/profile/ian_hussey mmmdata.io twitter.com/ianhussey osf.io/3kzh8 github.com/ianhussey