clear * creat the dataset for six cities * cd C:\TA-LDA insheet using lab5.meta-6cities.csv gen var=se^2 *graph(f)=fixed meta logrr se, graph(f) cline xline(0) id(city) xlab *graph(r)=random effects estimate meta logrr se, graph(r) cline xline(0) id(city) xlab *graph(e)=empirical bayes meta logrr se, graph(e) cline xline(0) id(city) xlab * The plot which put EB estimates and original estimates together gen n=_n gen gmean=0.66 graph twoway scatter ebest logrr gmean n, connect( . . l) * caculate the empirical bayes estimates *LA lambda, Empirical Bayes, and weights (the w_j from the notes -- used to calculate overall log RR) display 0.134/(0.134+0.0169) display (0.25*0.134+0.66*0.0169)/(0.134+0.0169) display 1/(0.134+0.0169)/(2/(0.134+0.0169)+1/(0.134+0.0625)+1/(0.134+0.3025)+1/(0.134+0.16)+1/(0.134+0.2025)) *NY display 0.134/(0.134+0.0625) display (1.4*0.134+0.66*0.0625)/(0.134+0.0625) display 1/(0.134+0.0625)/(2/(0.134+0.0169)+1/(0.134+0.0625)+1/(0.134+0.3025)+1/(0.134+0.16)+1/(0.134+0.2025)) *Chicago (lambda and weights are same as those for LA) display (0.6*0.134+0.66*0.0169)/(0.134+0.0169) *Dallas display 0.134/(0.134+0.3025) display (0.25*0.134+0.66*0.3025)/(0.134+0.3025) display 1/(0.134+0.3025)/(2/(0.134+0.0169)+1/(0.134+0.0625)+1/(0.134+0.3025)+1/(0.134+0.16)+1/(0.134+0.2025)) *Houston display 0.134/(0.134+0.16) display (0.45*0.134+0.66*0.16)/(0.134+0.16) display 1/(0.134+0.16)/(2/(0.134+0.0169)+1/(0.134+0.0625)+1/(0.134+0.3025)+1/(0.134+0.16)+1/(0.134+0.2025)) display 1/(0.134+0.16)/(2/(0.134+0.0169)+1/(0.134+0.0625)+1/(0.134+0.3025)+1/(0.134+0.16)+1/(0.134+0.2025)) *SD display 0.134/(0.134+0.2025) display (1*0.134+0.66*0.2025)/(0.134+0.2025) display 1/(0.134+0.2025)/(2/(0.134+0.0169)+1/(0.134+0.0625)+1/(0.134+0.3025)+1/(0.134+0.16)+1/(0.134+0.2025)) * other commands we can use to get similar results metan logrr se,random metareg logrr, wsvar(var)