Matherion / userfriendlyscience

The R userfriendlyscience package
https://userfriendlyscience.com
14 stars 7 forks source link

Error in lavaan::inspect #12

Open auduman opened 5 years ago

auduman commented 5 years ago

This is my first time reporting an issue, so please forgive any oversights!

I'm trying to calculate multiple estimates of reliability for some survey data, using 'scaleReliability' or 'scaleStructure'. I have reverse coded the relevant columns and am now trying to get omega, omega hierarchical, ordinal alpha and coefficient H estimates, and am encountering the following error message:

scaleStructure(dat = attitudes_l, items = 'all') Error in lavaan::inspect(fit, "coef") : object 'fit' not found

Not sure how to fix this! Any help would be appreciated

vince-p commented 4 years ago

I had the same issue and it was resolved by changing the column names in my dataframe. The reverse code function appends a "-" to the name of any variable that is reverse coded. The scaleReliability function doesnt seem to work with those names. Removing the hyphen from the names fixes the issue.