Hi All
I'm trying to run the below code to visualize odds ratios from three separate logistic regression models (figure attached). Overall, the code works but I'm unable to include the 'by(label)' option correctly. I've tried placing it in different parts of the code but I only get errors. I'd like to have a separate label for each of the three sets of estimates:
Example code of where I initially thought the 'by(label') option should be placed (but I've tried placing the option elsewhere like after the est1):
Further, I'm unable to drop the estimate for gender (but I was able to drop all other unwanted estimates!). I think this how to do with how the gender categories were labelled:
Any help would be really appreciated!
Thanks
/Amal
I'm trying to run the below code to visualize odds ratios from three separate logistic regression models (figure attached). Overall, the code works but I'm unable to include the 'by(label)' option correctly. I've tried placing it in different parts of the code but I only get errors. I'd like to have a separate label for each of the three sets of estimates:
Code:
coefplot (est1, mcolor(gray) ciopts(lcolor(gray))) /// (est2, mcolor(black) ciopts(lcolor(black))) /// (est3, mcolor(navy) ciopts(lcolor(navy))), xlabel (0(0.5)2) eform xtitle(OR (95% CI)) xline(1, lwidth(thin) lcolor(red)) drop(_cons gender2.Female 1.imd_5 2.imd_5 3.imd_5 4.imd_5 5.imd_5)
Example code of where I initially thought the 'by(label') option should be placed (but I've tried placing the option elsewhere like after the est1):
Code:
coefplot (est1, mcolor(gray) ciopts(lcolor(gray))) bylabel(Heart) || /// (est2, mcolor(black) ciopts(lcolor(black))) bylabel(Digestive) || /// (est3, mcolor(navy) ciopts(lcolor(navy))) bylabel(Respiratory) || , xlabel (0(0.5)2) eform xtitle(OR (95% CI)) xline(1, lwidth(thin) lcolor(red)) drop(_cons gender2.Female 1.imd_5 2.imd_5 3.imd_5 4.imd_5 5.imd_5)
Further, I'm unable to drop the estimate for gender (but I was able to drop all other unwanted estimates!). I think this how to do with how the gender categories were labelled:
Code:
. tab gender2 GENDER | Freq. Percent Cum. ------------+----------------------------------- Female | 8,867 42.95 42.95 Male | 11,779 57.05 100.00 ------------+----------------------------------- Total | 20,646 100.00
Code:
------------------------------------------------------------------------------------------------------------------------------------ gender2 GENDER ------------------------------------------------------------------------------------------------------------------------------------ Type: Numeric (long) Label: gender2 Range: [1,2] Units: 1 Unique values: 2 Missing .: 0/20,646 Tabulation: Freq. Numeric Label 8,867 1 Female 11,779 2 Male
Any help would be really appreciated!
Thanks
/Amal
Comment