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

predict.logistf with insufficient number of factor levels #65

Open
agleiss opened this issue Jun 24, 2024 · 0 comments
Open

predict.logistf with insufficient number of factor levels #65

agleiss opened this issue Jun 24, 2024 · 0 comments

Comments

@agleiss
Copy link

agleiss commented Jun 24, 2024

Hi Georg,
[MK said it is worth an issue... hope it is]
I fitted a model with logistf including a character column (not as factor but with, say, 4 different values). Trying to get predictions with predict on new data that only include one of the categories of the character column gives the error message

Fehler in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]]) :
Kontraste können nur auf Faktoren mit 2 oder mehr Stufen angewendet werden

Using new data that contain more than one different but not all categories gives the error message

Fehler in object$coefficients %*% t(X) : nicht passende Argumente

Using additional dummy rows representing all possible categories gives the requested predictions.

Thank you,
Andreas

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

No branches or pull requests

1 participant