Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option allow.empty.cell #377

Merged
merged 2 commits into from
Aug 5, 2024
Merged

add option allow.empty.cell #377

merged 2 commits into from
Aug 5, 2024

Conversation

ecmerkle
Copy link
Contributor

@ecmerkle ecmerkle commented Aug 5, 2024

This adds an extra option allow.empty.cell, which allows for ordinal variables that are missing some categories. This could involve an empty category in one group of a multi-group model, or a variable of class factor that (say) has 4 levels but only 3 are observed. My goal here is to have lavaan process these ordinal variables, so I can then model them in blavaan (where priors could compensate for the missing categories).

The default is allow.empty.cell = FALSE, where everything should work as usual.

For allow.empty.cell = TRUE, I had to set arbitrary starting values for the thresholds around empty categories. Assuming a variable with K categories, here is what I did:

Empty category 1: lower threshold -Inf, upper threshold -4
Empty category K: lower threshold 4, upper threshold Inf
Empty other category: upper threshold = .01 + lower threshold

@ecmerkle
Copy link
Contributor Author

ecmerkle commented Aug 5, 2024

will fix these failed checks...

@yrosseel yrosseel merged commit 56b8a11 into yrosseel:master Aug 5, 2024
5 checks passed
@yrosseel
Copy link
Owner

yrosseel commented Aug 5, 2024

Nice. Thanks! Merged now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants