Should we log-transform variables when building the predictive model?

Hello all,

I want to confirm if I need to log-transform my continuous predictor in my logistic regression. Below is the code that I am testing the linearity between my predictor vs log outcome. I wanna know, if there is a linear relationship between my continuous predictor vs log outcome, even my predictor is highly skewed, I don't need to log transform it, correct?

lr.fit4 <- glm(disease~ BMI, data=mydata, family=binomial(link="logit"))
summary(lr.fit4)
logodds <- lr.fit4$linear.predictors
plot(logodds ~ mydata$BMI)

Thanks so much!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.