Hello! There are three variables in my database: pneumonia (yes / no), death (yes / no) and age (various categories). I need to show that patients with pneumonia die more often than without pneumonia adjusted for age (age adjusted mortality rate). How can I do it?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(age death pneumonia) 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 2 1 1 2 0 0 2 0 0 2 0 0 5 0 0 5 0 0 5 0 0 5 1 1 5 1 1 6 1 1 6 1 1 6 1 1 6 0 0 7 0 0 7 1 0 7 1 1 7 1 0 7 1 1 8 1 0 8 1 1 8 1 1 8 1 1 8 1 1 3 0 1 3 0 1 3 0 0 3 0 0 3 1 1 4 0 1 4 0 0 4 1 1 4 1 1 4 0 1 end label values age age label def age 0 "20-29", modify label def age 1 "30-39", modify label def age 2 "40-49", modify label def age 3 "50-59", modify label def age 4 "60-69", modify label def age 5 "70-79", modify label def age 6 "80-89", modify label def age 7 "90-99", modify label def age 8 "100-109", modify label values death death label def death 0 "no", modify label def death 1 "yes", modify label values pneumonia pneumonia label def pneumonia 0 "no", modify label def pneumonia 1 "yes", modify
Comment