*unadjusted IR* ir Count EthnicityWhite0 PersonYears mepoisson Count EthnicityWhite0, exposure(PersonYears) vce(cluster LSOA) irr *adjust for age gender, then deprivation* mepoisson Count i.EthnicityWhite0 AgeCategory i.Genderf0, exposure(PersonYears) || LSOA: , vce(cluster LSOA) irr mepoisson Count i.EthnicityWhite0 AgeCategory i.Genderf0 c.IMD, exposure(PersonYears) || LSOA: , vce(cluster LSOA) irr *complete model with interaction term* mepoisson Count i.EthnicityWhite0##c.EthnicDensity_Pakistani AgeCategory i.Genderf0 c.IMD, exposure(PersonYears) || LSOA: , vce(cluster LSOA) irr *Complete model with area level random effects equation* mepoisson Count i.EthnicityWhite0##c.EthnicDensity_Pakistani AgeCategory i.Genderf0 c.IMD, exposure(PersonYears) || LSOA: , irr *examine interaction by splitting into high or low density* *generate high low density and quartiles* mean EthnicDensity_Pakistani tab EthnicDensity_Pakistani gen high=1 if EthnicDensity_Pakistani>12.79 replace high=0 if EthnicDensity_Pakistani<12.79 tab high mean EthnicDensity_Pakistani, over(high) by high, sort : mepoisson Count i.EthnicityWhite0 AgeCategory i.Genderf0 c.IMD, exposure(PersonYears) vce(cluster LSOA) irr *compare by Pakistani quartiles* drop if EthnicityWhite0==0 xtile density4 = EthnicDensity_Pakistani, nq(4) mean EthnicDensity_Pakistani, over(density4) mepoisson Count b4.density4 AgeCategory i.Genderf0 c.IMD, exposure(PersonYears) vce(cluster LSOA) irr *compare within White Quartiles* *reload dataset and use EthnicDensity_White equivalent in previous step*