Hello everyone!
I am conducting a multilevel analysis using melogit in STATA 17. I have nested data and I want to conduct a multilevel regression.
In my dataset my outcome is Obesity (variable = BMI_catOb), my exposure is the density of unhealthy retailers around schools that was categorized into tertiles (variable= ter_DE_Unhealthy) and I want to test for an interaction between ter_DE_Unhealthy and type of school (public=1 private=2) (variable =type_school)
1. I added an interaction term and I got the below results.
Based on the above table I can deduce that for public school (type_school=1) the Odds ratios for tertile#2 of ter_DE_Unehalthy is equal to 1.739 and OR for tertile#3 is equal to 1.961. would that be a correct?
2. Then I tried to stratify by school. I am presenting below the results for public school (type_school=1)
Based on the above table the ORs are 1.745 and 1.967 for tertile#2 and tertile#3, respectively. I am surprised that the ORs are not the same. What could be the reason? is it related to the melogit command?
Because if I use a logistic regression, I get the same ORs in the interaction model and the stratified model (cf. below). OR for tertile#2 of ter_DE_Unhealthy is 1.733 and for tertile#3 it is 1.954 and we have exactly the same coefficients when I stratified by type of school.
1-Interaction:
2-Stratificaion:
Many thanks !!
I am conducting a multilevel analysis using melogit in STATA 17. I have nested data and I want to conduct a multilevel regression.
In my dataset my outcome is Obesity (variable = BMI_catOb), my exposure is the density of unhealthy retailers around schools that was categorized into tertiles (variable= ter_DE_Unhealthy) and I want to test for an interaction between ter_DE_Unhealthy and type of school (public=1 private=2) (variable =type_school)
1. I added an interaction term and I got the below results.
Code:
- melogit BMI_catOb i.ter_DE_Unhealthy##i.type_school || sclid:, or
2. Then I tried to stratify by school. I am presenting below the results for public school (type_school=1)
Code:
- melogit BMI_catOb i.ter_DE_Unhealthy if type_school==1 || sclid:, or
Because if I use a logistic regression, I get the same ORs in the interaction model and the stratified model (cf. below). OR for tertile#2 of ter_DE_Unhealthy is 1.733 and for tertile#3 it is 1.954 and we have exactly the same coefficients when I stratified by type of school.
1-Interaction:
Code:
. logistic BMI_catOb i.ter_DE_Unhealthy##type_school Logistic regression Number of obs = 2,465 LR chi2(5) = 22.41 Prob > chi2 = 0.0004 Log likelihood = -1128.1909 Pseudo R2 = 0.0098 ---------------------------------------------------------------------------------------------- BMI_catOb | Odds ratio Std. err. z P>|z| [95% conf. interval] -----------------------------+---------------------------------------------------------------- ter_DE_Unhealthy | 2 | 1.733965 .3015293 3.17 0.002 1.233161 2.438151 3 | 1.954811 .3493899 3.75 0.000 1.377104 2.774871 | type_school | private | 1.942005 .3921945 3.29 0.001 1.307216 2.88505 | ter_DE_Unhealthy#type_school | 2#private | .4783882 .1502061 -2.35 0.019 .2585336 .8852051 3#private | .6124526 .168066 -1.79 0.074 .3576764 1.048708 | _cons | .1241535 .0177497 -14.59 0.000 .0938137 .1643053 ---------------------------------------------------------------------------------------------- Note: _cons estimates baseline odds.
Code:
. logistic BMI_catOb i.ter_DE_Unhealthy if type_school==1 Logistic regression Number of obs = 1,751 LR chi2(2) = 16.16 Prob > chi2 = 0.0003 Log likelihood = -773.02716 Pseudo R2 = 0.0103 ---------------------------------------------------------------------------------- BMI_catOb | Odds ratio Std. err. z P>|z| [95% conf. interval] -----------------+---------------------------------------------------------------- ter_DE_Unhealthy | 2 | 1.733965 .3015293 3.17 0.002 1.233161 2.438152 3 | 1.954811 .3493899 3.75 0.000 1.377104 2.774872 | _cons | .1241535 .0177497 -14.59 0.000 .0938137 .1643053 ----------------------------------------------------------------------------------
Comment