Hello,
First of all, thank you for providing such a great package, its extremely helpful.
I wanted to report an issue I encountered while fitting a logistic regression model including factor variables using the psfmi_lr() function. I received the following error:
Error in family$linkfun(mustart) :Argument mu must be a nonempty numeric vector
Alongside this, several warnings appeared, all related to factor predictors. Most of them included the message:
Caused by warning in as.numeric(): ! NAs introduced by coercion
After investigating, I noticed that within the code, factor variables are being converted using the following line:
data <- mutate_if(data, is.factor, ~ as.numeric(as.character(.x)))
This transformation introduces NAs when the factor levels are non-numeric (e.g., character labels), which I believe leads to the error.
I tested this by forking the package and removing that line — and everything worked correctly afterwards.
Best regards
Hello,
First of all, thank you for providing such a great package, its extremely helpful.
I wanted to report an issue I encountered while fitting a logistic regression model including factor variables using the psfmi_lr() function. I received the following error:
Error in family$linkfun(mustart) :Argument mu must be a nonempty numeric vectorAlongside this, several warnings appeared, all related to factor predictors. Most of them included the message:
Caused by warning in as.numeric(): ! NAs introduced by coercionAfter investigating, I noticed that within the code, factor variables are being converted using the following line:
data <- mutate_if(data, is.factor, ~ as.numeric(as.character(.x)))This transformation introduces NAs when the factor levels are non-numeric (e.g., character labels), which I believe leads to the error.
I tested this by forking the package and removing that line — and everything worked correctly afterwards.
Best regards