need help for statistic command: STATA

need help for statistic command: STATA

by Thongchai -
Number of replies: 3

I want to look for association of age(years) and advanced disease(Y/N) to be stratified by sex

What Stata command should I use?

Thank you in advance.

In reply to Thongchai

Re: need help for statistic command: STATA

by Megha Mehrotra -

There are a few ways you can do this. One that we covered in lecture is the mhodds command. You could use mhodds outcomevar exposurevar, by(groupvar) to give you the odds of advanced disease given a 1 unit increase in age stratified by sex.

In reply to Thongchai

Re: need help for statistic command: STATA

by Brett Ley -

Hi Thongchai,

This depends on your study design, research question, and whether age is a continuous or categorical.

If your study is a cohort study,and age is categorical, then you could use the cs command that we learned in class: cs advanceddisease agecategorical, by(sex). This will give you the RR for advanced disease for each unit increase in age category, stratified by sex, allowing you to look for an interaction/effect modification of sex on the association between age and advanced disease.

If your study is a case-control study, and age is categorical, then you could use the cc command: cc advanceddisease agecategorical, by(sex). This will give you the OR for advanced disease for each unit increase age category, stratified by sex, allowing you to look for an interaction/effect modification of sex on the association between age and advanced disease.

For both of these, if you have >2 categories for age, then you will just get a RR/OR for each unit increase in age category (statified by sex), which may not be appropriate.

If you want to leave age as a continuous variable, you could also use the mhodds command we learned in class: mhodds advanceddisease age, by(sex). This will give you the OR for advanced disease for a one-unit increase in age stratified by sex.

For either study design, assuming advanced disease is the outcome you are interested in and you want to keep age as a continuous variable, a better approach may be to use a logistic regression model with an interaction term for age and sex: logistic advanceddisease c.age##i.sex. This will require some intepretation. If the interaction term for age and sex does not look significant you may just want use the model looking for the main effects of age and sex on advanced disease: logistic advanceddisease age sex.

Hope this helps.