Hi Listers,

I am interested in assessing the relationship between diabetes diagnosis (yes/no) and age in my data. In the summary statistics, we report results by age group but for this analysis I am opting to use age as continuous - still to clear it with my colleagues.

it was suggested I may want to use the Cochran-Armitage trend test using ptrend

ptrend nyes nno age

The Chi2 for departure has p<.001 which suggests the null hypothesis is not met. Does it mean that I should not be using the CA test as the assumption of linearity is not met?

I am also considering that, seen that I am using age as continuous, I could simply run a simple logistic regression with age as a predictor. Is there a way to assess if there is a linear association between diagnosis and age? Plotting the data shows a decrease with a dip at age 55 which is followed by an increase in diagnosis rates which suggests a non-linear association.

What's the best way forward?

Thank you in advance!