How can you conduct a test for linear trend of log odds?


I'm trying to figure out to test for a linear trend from the logistic regression. My outcome variable is age, and now it has been ordered. I've been recommended to a chi square- goodness of fit- I'm not sure if that makes sense.

I thought that the question from the boss was about using the the likelihood as an overall estimate of the fit of the model.

Here is an example of estimates:

Call:  glm(formula = y ~ x, family = binomial(link = "logit"))

(Intercept)            x 
     -9.083        3.187 

Degrees of Freedom: 40 Total (i.e. Null);  39 Residual
Null Deviance:        56.62
Residual Deviance: 20.47     AIC: 24.47
And here is a link to explanations.


Not a robit
OP doesn't say "boss", I was thinking at first of a non-savvy peer-reviewer. If the coefficient is significant in the model then you likely have a positive trend. Though you could always fit a general additive model (GAM), to explicitly look at the relationship to ensure it is not non-linear. Or another option is to add a quadratic term to the model and see if it is significant or do the box test? of y = x + log(x*x) [I believe, that is right but it has been awhile]. You could do the categorical approach, but if it seems apparent that there is a linear relationship, I would revert back to using the model with it as continuous variable. I am not sure what they are desiring with the chi-square, perhaps the -2loglikelihood test, but that seems inappropriate or not well define in the use case.