Hae guys have been trying to figure out the command for testing linearity assumption for log odds vs continuous predictors in logistic regression in STATA. I have not been able to get one since the internet does not discuss much of this particular assumption in STATA. I just need the code or a way of doing it.Thanks in advance
Announcement
Collapse
No announcement yet.
X

I generally do it two ways. First, I do it graphically lowess outcome predictor, logit. If there is a reasonably linear relationship between the predictor and log odds outcome, the curve will be more or less a straight line. Don't worry about wiggling or curvature at the ends: focus on the center of the graph.
Then I fit my logistic regression model and look at how well calibrated the model is. estat gof, group(#) table will give you this information. (Replace # by an actual number of groups, the number of groups should be chosen so that each will contain something in the range of 30 to 100 observations.) Look for the observed and expected counts to be roughly equal.
 2 likes
Comment