<div dir="ltr"><div>Hello!<br></div><div>My name is Olivia and I'm a researcher at Stanford University. Our group is trying to calculate relative risk ratios for the a meta-analysis extracting incidence rates of tuberculosis disease using the metafor package. <div><br></div><div><u>Study Design: </u></div><div>Incidence rates were extracted for each study identified by a systematic review, with some studies reporting multiple rates for different years or locations. In this case, multiple rates were treated as different study cohorts, meaning that the data is clustered ('cohort_id' nested within 'study_id'). </div><div><br></div><div><u>Model:</u></div><div>We used the <a href="http://rma.mv/" target="_blank">rma.mv</a>() function, inputting the calculated incidence rate as the outcome variable ('pdc$yi), the variance ('pdc$vi'), WHO region ('who_region') and whether the study was conducted through passive or active screening (passive_active') as moderators, and a random effects argument for the study level ('study_id'). We are unclear how to go from the output to Risk Ratios. </div><div><br></div><div><u>Data:</u></div><div><table border="0" cellpadding="0" cellspacing="0" width="522" style="border-collapse:collapse;width:390pt"><colgroup><col width="87" span="6" style="width:65pt"></colgroup><tbody><tr height="23" style="height:17pt"><td height="23" class="gmail-m_-1772065927872993729gmail-xl63" align="left" width="87" style="font-family:Consolas,sans-serif;height:17pt;width:65pt;color:rgb(36,39,41);font-size:13pt;padding-top:1px;padding-right:1px;padding-left:1px;vertical-align:bottom;border:none;white-space:nowrap">study_id</td><td align="left" width="87" style="font-family:Calibri,sans-serif;width:65pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">cohort_id</td><td align="left" width="87" style="font-family:Calibri,sans-serif;width:65pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">n_diagnosed</td><td align="left" width="87" style="font-family:Calibri,sans-serif;width:65pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">person_years</td><td align="left" width="87" style="font-family:Calibri,sans-serif;width:65pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap"> who_region</td><td align="left" width="87" style="font-family:Calibri,sans-serif;width:65pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">passive_active</td></tr><tr height="23" style="height:17pt"><td height="23" class="gmail-m_-1772065927872993729gmail-xl63" align="right" style="font-family:Consolas,sans-serif;height:17pt;color:rgb(36,39,41);font-size:13pt;padding-top:1px;padding-right:1px;padding-left:1px;vertical-align:bottom;border:none;white-space:nowrap">131</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">34</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">77</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">14298</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap"> 1Americas</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">1Passive</td></tr><tr height="23" style="height:17pt"><td height="23" class="gmail-m_-1772065927872993729gmail-xl63" align="right" style="font-family:Consolas,sans-serif;height:17pt;color:rgb(36,39,41);font-size:13pt;padding-top:1px;padding-right:1px;padding-left:1px;vertical-align:bottom;border:none;white-space:nowrap">93</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">120</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">5</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">27750</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap"> 1Americas</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">1Passive</td></tr><tr height="23" style="height:17pt"><td height="23" class="gmail-m_-1772065927872993729gmail-xl63" align="right" style="font-family:Consolas,sans-serif;height:17pt;color:rgb(36,39,41);font-size:13pt;padding-top:1px;padding-right:1px;padding-left:1px;vertical-align:bottom;border:none;white-space:nowrap">93</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">121</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">14</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">277150</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap"> 1Americas</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">1Passive</td></tr><tr height="23" style="height:17pt"><td height="23" class="gmail-m_-1772065927872993729gmail-xl63" align="right" style="font-family:Consolas,sans-serif;height:17pt;color:rgb(36,39,41);font-size:13pt;padding-top:1px;padding-right:1px;padding-left:1px;vertical-align:bottom;border:none;white-space:nowrap">93</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">122</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">15</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">2000</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap"> 1Americas</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">1Passive</td></tr><tr height="23" style="height:17pt"><td height="23" class="gmail-m_-1772065927872993729gmail-xl63" align="right" style="font-family:Consolas,sans-serif;height:17pt;color:rgb(36,39,41);font-size:13pt;padding-top:1px;padding-right:1px;padding-left:1px;vertical-align:bottom;border:none;white-space:nowrap">136</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">383</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">2</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">2000</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap"> Africa</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">2Active</td></tr><tr height="23" style="height:17pt"><td height="23" class="gmail-m_-1772065927872993729gmail-xl63" align="right" style="font-family:Consolas,sans-serif;height:17pt;color:rgb(36,39,41);font-size:13pt;padding-top:1px;padding-right:1px;padding-left:1px;vertical-align:bottom;border:none;white-space:nowrap">136</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">383</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">7</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">100000</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap"> Africa</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">2Active</td></tr><tr height="23" style="height:17pt"><td height="23" class="gmail-m_-1772065927872993729gmail-xl63" align="right" style="font-family:Consolas,sans-serif;height:17pt;color:rgb(36,39,41);font-size:13pt;padding-top:1px;padding-right:1px;padding-left:1px;vertical-align:bottom;border:none;white-space:nowrap">187</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">16</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">16</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">100000</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap"> Africa</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">3Not Specified</td></tr><tr height="23" style="height:17pt"><td height="23" class="gmail-m_-1772065927872993729gmail-xl63" align="right" style="font-family:Consolas,sans-serif;height:17pt;color:rgb(36,39,41);font-size:13pt;padding-top:1px;padding-right:1px;padding-left:1px;vertical-align:bottom;border:none;white-space:nowrap">187</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">517</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">2</td><td align="right" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">100000</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap"> S.E. Asia</td><td align="left" style="font-family:Calibri,sans-serif;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:12pt;vertical-align:bottom;border:none;white-space:nowrap">3Not Specified</td></tr></tbody></table></div><div><br></div><div><br><u>Code:</u></div><div><br></div><div>library(xlsx)</div><div>library(metafor)<br><br><br>data <- read.xlsx('702_tb_incidence.xlsx', 1)<br>print(data)<br><br></div><div>#calculating the incidence rate and the variance<br>pd_ec <- escalc(<br> measure = 'IR',<br> xi = data$n_diagnosed,<br> ti = data$person_years,<br> data = data<br>)<br>pd_ec<br><br>#specifying mixed effects model</div><div>#first level cohort incidence rate and variation</div><div>#second level study_id</div><div>#who_region and passive_active as moderators<br>m0 <- <a href="http://rma.mv/" target="_blank">rma.mv</a>(pd_ec$yi, pd_ec$vi, method='REML', mods = ~ who_region + passive_active,<br> random= ~ 1 | study_id,<br> tdist=TRUE,<br> data=pd_ec)<br><br>summary(m0)<br></div><div><br></div><div><u>Output:</u></div><div><pre style="white-space:pre-wrap;box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;color:rgb(0,0,0);border:0px;border-radius:0px;vertical-align:baseline">Multivariate Meta-Analysis Model (k = 8; method: REML)
logLik Deviance AIC BIC AICc
15.4961 -30.9922 -20.9922 -24.0607 39.0078
Variance Components:
estim sqrt nlvls fixed factor
sigma^2 0.0000 0.0037 4 no study_id
Test for Residual Heterogeneity:
QE(df = 4) = 94.4465, p-val < .0001
Test of Moderators (coefficients 2:4):
F(df1 = 3, df2 = 4) = 3.7931, p-val = 0.1152
Model Results:
estimate se tval pval <a href="http://ci.lb/" target="_blank">ci.lb</a> ci.ub
intrcpt 0.0027 0.0027 1.0073 0.3708 -0.0047 0.0101
who_regionAfrica -0.0025 0.0046 -0.5493 0.6120 -0.0153 0.0102
who_regionS.E. Asia -0.0027 0.0046 -0.5797 0.5932 -0.0154 0.0101
passive_active2Active -0.0001 0.0053 -0.0167 0.9874 -0.0148 0.0146 </pre><pre style="white-space:pre-wrap;box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;color:rgb(0,0,0);border:0px;border-radius:0px;vertical-align:baseline"><br></pre><pre style="white-space:pre-wrap;box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;color:rgb(0,0,0);border:0px;border-radius:0px;vertical-align:baseline"><font face="arial, sans-serif">Any advice/insight in much appreciated!</font></pre><pre style="white-space:pre-wrap;box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;color:rgb(0,0,0);border:0px;border-radius:0px;vertical-align:baseline"><font face="arial, sans-serif"><br></font></pre><pre style="white-space:pre-wrap;box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;color:rgb(0,0,0);border:0px;border-radius:0px;vertical-align:baseline"><font face="arial, sans-serif">Best wishes,</font></pre><pre style="white-space:pre-wrap;box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;color:rgb(0,0,0);border:0px;border-radius:0px;vertical-align:baseline"><font face="arial, sans-serif">Olivia</font></pre><div class="gmail-yj6qo gmail-ajU" style="outline:none;padding:10px 0px;width:22px;margin:2px 0px 0px"><br></div></div></div><div class="gmail-yj6qo gmail-ajU" style="outline:none;padding:10px 0px;width:22px;margin:2px 0px 0px"><br></div><div class="gmail-yj6qo gmail-ajU" style="outline:none;padding:10px 0px;width:22px;margin:2px 0px 0px"><br></div><div class="gmail-yj6qo gmail-ajU" style="outline:none;padding:10px 0px;width:22px;margin:2px 0px 0px"><br></div></div>