-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
check_model fails if dependent variable is labelled #727
Comments
Thanks, should be fixed in insight, which will be submitted to CRAN the next days. |
@larmarange Is it necessary to preserve See from
label(s) attributes can be used for standard R classes, so no need to keep the If not really necessary in your package, maybe it's possible to remove the |
Hi. labelled::labelled() is identical to haven::labelled() The labelled package just provides functions to manipulate such vectors. Such vectors are not intended to be used in a model. They should be transformed into factors with to_factor() or numeric/character vectors with unclass() before modelling (You could also use unlabelled()). In performance, I do not see the need to support such vectors. In gtsummary, fire example, there is a warning saying to the user if he didn't forget to transform these vectors before analysis. |
So the error here is to use a haven_labelled vector in a model. The variable am should have been transformed into a factor to be correctly be considered as categorical by the model. |
Yes, I agree. The problem often is that users aren't aware that labelled data can be of classes |
Hi there,
i run i a bug with labelled data, similar to #629 .
check_model()
will fail if the dependend variable islabelled
The text was updated successfully, but these errors were encountered: