<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>R与meta分析 | 阿狸的Blog</title><link>https://www.aliyisheng.blog/course/chapter1/</link><atom:link href="https://www.aliyisheng.blog/course/chapter1/index.xml" rel="self" type="application/rss+xml"/><description>R与meta分析</description><generator>Wowchemy (https://wowchemy.com)</generator><language>zh-Hans</language><lastBuildDate>Sun, 09 Sep 2018 00:00:00 +0000</lastBuildDate><image><url>https://www.aliyisheng.blog/media/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_2.png</url><title>R与meta分析</title><link>https://www.aliyisheng.blog/course/chapter1/</link></image><item><title>森林图</title><link>https://www.aliyisheng.blog/course/chapter1/%E6%A3%AE%E6%9E%97%E5%9B%BE/</link><pubDate>Sun, 05 May 2019 00:00:00 +0100</pubDate><guid>https://www.aliyisheng.blog/course/chapter1/%E6%A3%AE%E6%9E%97%E5%9B%BE/</guid><description>&lt;h2 id="说明">说明&lt;/h2>
&lt;p>森林图是Meta分析中常用的可视化技术，它显示单个研究的结果(即估计的效果或观察到的结果)及其(通常为95%)置信区间。一个四边多边形(有时称为汇总‘菱形’)被添加到绘图的底部，显示基于模型的汇总估计值(多边形的中心对应于估计值，左/右边缘表示置信区间界限)。下面是这样一个森林图的例子。&lt;/p>
&lt;h2 id="图例">图例&lt;/h2>
&lt;p>&lt;img src="https://i.loli.net/2021/03/11/jvGnE9lwPO3hfVT.png" alt="img">&lt;/p>
&lt;h2 id="代码">代码&lt;/h2>
&lt;pre>&lt;code class="language-r">library(metafor)
### copy BCG vaccine meta-analysis data into 'dat'
dat &amp;lt;- dat.bcg
### calculate log risk ratios and corresponding sampling variances (and use
### the 'slab' argument to store study labels as part of the data frame)
dat &amp;lt;- escalc(measure=&amp;quot;RR&amp;quot;, ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat,
slab=paste(author, year, sep=&amp;quot;, &amp;quot;))
### fit random-effects model
res &amp;lt;- rma(yi, vi, data=dat)
### forest plot with extra annotations
forest(res, atransf=exp, at=log(c(.05, .25, 1, 4)), xlim=c(-16,6),
ilab=cbind(dat.bcg$tpos, dat.bcg$tneg, dat.bcg$cpos, dat.bcg$cneg),
ilab.xpos=c(-9.5,-8,-6,-4.5), cex=.75, header=&amp;quot;Author(s) and Year&amp;quot;,
mlab=&amp;quot;&amp;quot;)
op &amp;lt;- par(cex=.75, font=2)
text(c(-9.5,-8,-6,-4.5), 15, c(&amp;quot;TB+&amp;quot;, &amp;quot;TB-&amp;quot;, &amp;quot;TB+&amp;quot;, &amp;quot;TB-&amp;quot;))
text(c(-8.75,-5.25), 16, c(&amp;quot;Vaccinated&amp;quot;, &amp;quot;Control&amp;quot;))
par(op)
### add text with Q-value, dfs, p-value, and I^2 statistic
text(-16, -1, pos=4, cex=0.75, bquote(paste(&amp;quot;RE Model (Q = &amp;quot;,
.(formatC(res$QE, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;, df = &amp;quot;, .(res$k - res$p),
&amp;quot;, p = &amp;quot;, .(formatC(res$QEp, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;; &amp;quot;, I^2, &amp;quot; = &amp;quot;,
.(formatC(res$I2, digits=1, format=&amp;quot;f&amp;quot;)), &amp;quot;%)&amp;quot;)))
&lt;/code>&lt;/pre></description></item><item><title>森林图亚组分析</title><link>https://www.aliyisheng.blog/course/chapter1/%E6%A3%AE%E6%9E%97%E5%9B%BE%E4%BA%9A%E7%BB%84%E5%88%86%E6%9E%90/</link><pubDate>Sun, 05 May 2019 00:00:00 +0100</pubDate><guid>https://www.aliyisheng.blog/course/chapter1/%E6%A3%AE%E6%9E%97%E5%9B%BE%E4%BA%9A%E7%BB%84%E5%88%86%E6%9E%90/</guid><description>&lt;h2 id="说明">说明&lt;/h2>
&lt;p>下面的描述是具有三个子组的森林样地的示例。个别研究的结果按其分组显示在一起。在每个子组下面，一个汇总多边形显示了将随机效果模型仅拟合到该组内的研究时的结果。图底部的汇总多边形显示了在分析所有13项研究时随机效果模型的结果。&lt;/p>
&lt;h2 id="图示">图示&lt;/h2>
&lt;p>&lt;img src="https://i.loli.net/2021/03/11/pyVrORfGcKMbUi9.png" alt="">&lt;/p>
&lt;h2 id="代码">代码&lt;/h2>
&lt;pre>&lt;code class="language-R">library(metafor)
### copy BCG vaccine meta-analysis data into 'dat'
dat &amp;lt;- dat.bcg
### calculate log risk ratios and corresponding sampling variances (and use
### the 'slab' argument to store study labels as part of the data frame)
dat &amp;lt;- escalc(measure=&amp;quot;RR&amp;quot;, ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat,
slab=paste(author, year, sep=&amp;quot;, &amp;quot;))
### fit random-effects model
res &amp;lt;- rma(yi, vi, data=dat)
### set up forest plot (with 2x2 table counts added; the 'rows' argument is
### used to specify in which rows the outcomes will be plotted)
forest(res, xlim=c(-16, 6), at=log(c(0.05, 0.25, 1, 4)), atransf=exp,
ilab=cbind(dat$tpos, dat$tneg, dat$cpos, dat$cneg),
ilab.xpos=c(-9.5,-8,-6,-4.5), cex=0.75, ylim=c(-1, 27),
order=order(dat$alloc), rows=c(3:4,9:15,20:23),
xlab=&amp;quot;Risk Ratio&amp;quot;, mlab=&amp;quot;&amp;quot;, psize=1, header=&amp;quot;Author(s) and Year&amp;quot;)
### add text with Q-value, dfs, p-value, and I^2 statistic
text(-16, -1, pos=4, cex=0.75, bquote(paste(&amp;quot;RE Model for All Studies (Q = &amp;quot;,
.(formatC(res$QE, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;, df = &amp;quot;, .(res$k - res$p),
&amp;quot;, p = &amp;quot;, .(formatC(res$QEp, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;; &amp;quot;, I^2, &amp;quot; = &amp;quot;,
.(formatC(res$I2, digits=1, format=&amp;quot;f&amp;quot;)), &amp;quot;%)&amp;quot;)))
### fit meta-regression model to test for subgroup differences
res &amp;lt;- rma(yi, vi, mods = ~ alloc, data=dat)
### add text for the test of subgroup differences
text(-16, -1.8, pos=4, cex=0.75, bquote(paste(&amp;quot;Test for Subgroup Differences: &amp;quot;,
Q[M], &amp;quot; = &amp;quot;, .(formatC(res$QM, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;, df = &amp;quot;, .(res$p - 1),
&amp;quot;, p = &amp;quot;, .(formatC(res$QMp, digits=2, format=&amp;quot;f&amp;quot;)))))
### set font expansion factor (as in forest() above) and use bold italic
### font and save original settings in object 'op'
op &amp;lt;- par(cex=0.75, font=4)
### add text for the subgroups
text(-16, c(24,16,5), pos=4, c(&amp;quot;Systematic Allocation&amp;quot;,
&amp;quot;Random Allocation&amp;quot;,
&amp;quot;Alternate Allocation&amp;quot;))
### switch to bold font
par(font=2)
### add column headings to the plot
text(c(-9.5,-8,-6,-4.5), 26, c(&amp;quot;TB+&amp;quot;, &amp;quot;TB-&amp;quot;, &amp;quot;TB+&amp;quot;, &amp;quot;TB-&amp;quot;))
text(c(-8.75,-5.25), 27, c(&amp;quot;Vaccinated&amp;quot;, &amp;quot;Control&amp;quot;))
### set par back to the original settings
par(op)
### fit random-effects model in the three subgroups
res.s &amp;lt;- rma(yi, vi, subset=(alloc==&amp;quot;systematic&amp;quot;), data=dat)
res.r &amp;lt;- rma(yi, vi, subset=(alloc==&amp;quot;random&amp;quot;), data=dat)
res.a &amp;lt;- rma(yi, vi, subset=(alloc==&amp;quot;alternate&amp;quot;), data=dat)
### add summary polygons for the three subgroups
addpoly(res.s, row=18.5, cex=0.75, atransf=exp, mlab=&amp;quot;&amp;quot;)
addpoly(res.r, row= 7.5, cex=0.75, atransf=exp, mlab=&amp;quot;&amp;quot;)
addpoly(res.a, row= 1.5, cex=0.75, atransf=exp, mlab=&amp;quot;&amp;quot;)
### add text with Q-value, dfs, p-value, and I^2 statistic for subgroups
text(-16, 18.5, pos=4, cex=0.75, bquote(paste(&amp;quot;RE Model for Subgroup (Q = &amp;quot;,
.(formatC(res.s$QE, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;, df = &amp;quot;, .(res.s$k - res.s$p),
&amp;quot;, p = &amp;quot;, .(formatC(res.s$QEp, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;; &amp;quot;, I^2, &amp;quot; = &amp;quot;,
.(formatC(res.s$I2, digits=1, format=&amp;quot;f&amp;quot;)), &amp;quot;%)&amp;quot;)))
text(-16, 7.5, pos=4, cex=0.75, bquote(paste(&amp;quot;RE Model for Subgroup (Q = &amp;quot;,
.(formatC(res.r$QE, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;, df = &amp;quot;, .(res.r$k - res.r$p),
&amp;quot;, p = &amp;quot;, .(formatC(res.r$QEp, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;; &amp;quot;, I^2, &amp;quot; = &amp;quot;,
.(formatC(res.r$I2, digits=1, format=&amp;quot;f&amp;quot;)), &amp;quot;%)&amp;quot;)))
text(-16, 1.5, pos=4, cex=0.75, bquote(paste(&amp;quot;RE Model for Subgroup (Q = &amp;quot;,
.(formatC(res.a$QE, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;, df = &amp;quot;, .(res.a$k - res.a$p),
&amp;quot;, p = &amp;quot;, .(formatC(res.a$QEp, digits=2, format=&amp;quot;f&amp;quot;)), &amp;quot;; &amp;quot;, I^2, &amp;quot; = &amp;quot;,
.(formatC(res.a$I2, digits=1, format=&amp;quot;f&amp;quot;)), &amp;quot;%)&amp;quot;)))
&lt;/code>&lt;/pre></description></item><item><title>漏斗图的变化</title><link>https://www.aliyisheng.blog/course/chapter1/%E6%BC%8F%E6%96%97%E5%9B%BE%E7%9A%84%E5%8F%98%E5%8C%96/</link><pubDate>Sun, 05 May 2019 00:00:00 +0100</pubDate><guid>https://www.aliyisheng.blog/course/chapter1/%E6%BC%8F%E6%96%97%E5%9B%BE%E7%9A%84%E5%8F%98%E5%8C%96/</guid><description>&lt;h2 id="说明">说明&lt;/h2>
&lt;p>漏斗图显示了x轴上观察到的效应大小或结果，与y轴上观察到的效应大小或结果的精度进行了比较。基于Sterne和Egger(2001)，y轴的推荐选择是标准误差(按降序)，这也是metafor包中漏斗()函数的默认设置。在没有发表偏差和异质性的情况下，人们可能会看到这些点形成漏斗形状，大多数点落入伪置信度区域内，界限为^θ±1.96SEθ^±1.96SE，其中^θθ^是基于固定效应模型估计的效果或结果，SESE是来自y轴的标准误差值。对于y轴的其他精度度量，漏斗的预期形状可能会有很大不同。下图显示了y轴的各种选择，以及这如何影响漏斗图的形状(以及伪置信度区域的形式)。&lt;/p>
&lt;h2 id="图例">图例&lt;/h2>
&lt;p>&lt;img src="https://i.loli.net/2021/03/11/KPFj32chEL8VRow.png" alt="img">&lt;/p>
&lt;h2 id="代码">代码&lt;/h2>
&lt;pre>&lt;code>library(metafor)
### fit fixed-effects model
res &amp;lt;- rma(yi, vi, data=dat.hackshaw1998, measure=&amp;quot;OR&amp;quot;, method=&amp;quot;FE&amp;quot;)
### set up 2x2 array for plotting
par(mfrow=c(2,2))
### draw funnel plots
funnel(res, main=&amp;quot;Standard Error&amp;quot;)
funnel(res, yaxis=&amp;quot;vi&amp;quot;, main=&amp;quot;Sampling Variance&amp;quot;)
funnel(res, yaxis=&amp;quot;seinv&amp;quot;, main=&amp;quot;Inverse Standard Error&amp;quot;)
funnel(res, yaxis=&amp;quot;vinv&amp;quot;, main=&amp;quot;Inverse Sampling Variance&amp;quot;)
&lt;/code>&lt;/pre>
&lt;h2 id="参考文献">参考文献&lt;/h2>
&lt;p>Sterne, J. A. C., &amp;amp; Egger, M. (2001). Funnel plots for detecting bias in meta-analysis: Guidelines on choice of axis. &lt;em>Journal of Clinical Epidemiology, 54&lt;/em>(10), 1046–1055.&lt;/p></description></item><item><title>轮廓增强漏斗图</title><link>https://www.aliyisheng.blog/course/chapter1/%E8%BD%AE%E5%BB%93%E5%A2%9E%E5%BC%BA%E6%BC%8F%E6%96%97%E5%9B%BE/</link><pubDate>Sun, 05 May 2019 00:00:00 +0100</pubDate><guid>https://www.aliyisheng.blog/course/chapter1/%E8%BD%AE%E5%BB%93%E5%A2%9E%E5%BC%BA%E6%BC%8F%E6%96%97%E5%9B%BE/</guid><description>&lt;h2 id="说明">说明&lt;/h2>
&lt;p>下面是一个有时被称为轮廓增强漏斗图的例子(Peters等人，2008年)。请注意，漏斗的中心位置不是模型估计值(绘制漏斗图时通常是这样)，而是在0处(即，在无效果的零假设下的值)。点/研究的不同统计意义级别由阴影区域表示。特别地，中间的无阴影(即白色)区域对应于大于.10的p值，深灰色阴影区域对应于介于.10和.05之间的p值，中等灰色阴影区域对应于介于0.05和0.01之间的p值，并且漏斗外部区域对应于低于0.01的p值。以这种方式绘制的漏斗图对于检测由于抑制了不重要的发现而导致的发表偏差更有用。见彼得斯等人。(2008)了解更多细节。注意，根据Sterne和Egger(2001)，垂直轴代表标准误差(与Peters等人，2008年相比，他们在垂直轴上使用标准误差的倒数)。&lt;/p>
&lt;h2 id="图例">图例&lt;/h2>
&lt;p>&lt;img src="https://i.loli.net/2021/03/11/5HUotD6LxXTRhPy.png" alt="img">&lt;/p>
&lt;h2 id="代码">代码&lt;/h2>
&lt;pre>&lt;code>library(metafor)
### fit random-effects model
res &amp;lt;- rma(measure=&amp;quot;RR&amp;quot;, ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
### create contour enhanced funnel plot (with funnel centered at 0)
funnel(res, level=c(90, 95, 99), shade=c(&amp;quot;white&amp;quot;, &amp;quot;gray55&amp;quot;, &amp;quot;gray75&amp;quot;), refline=0, legend=TRUE)
&lt;/code>&lt;/pre>
&lt;h2 id="参考文献">参考文献&lt;/h2>
&lt;p>Peters, J. L., Sutton, A. J., Jones, D. R., Abrams, K. R., &amp;amp; Rushton, L. (2008). Contour-enhanced meta-analysis funnel plots help distinguish publication bias from other causes of asymmetry. &lt;em>Journal of Clinical Epidemiology, 61&lt;/em>(10), 991–996.&lt;/p>
&lt;p>Sterne, J. A. C., &amp;amp; Egger, M. (2001). Funnel plots for detecting bias in meta-analysis: Guidelines on choice of axis. &lt;em>Journal of Clinical Epidemiology, 54&lt;/em>(10), 1046–1055.&lt;/p>
&lt;p>简介&lt;/p>
&lt;p>&lt;a href="https://www.algolia.com/" target="_blank" rel="noopener">Algolia&lt;/a>是为你的 APP 或者网站添加搜索的最佳方式。 开发人员可以使用 API 上传并同步希望搜索的数据，然后可以进行相关的配置，比如产品转化率等等。可以使用 InstantSearch 等前端框架进行自定义搜索，为用户创造最佳的搜索体验。&lt;/p>
&lt;h2 id="注册">注册&lt;/h2>
&lt;p>前往官方网站&lt;a href="https://www.algolia.com/" title="https://www.algolia.com/" target="_blank" rel="noopener">https://www.algolia.com/&lt;/a> 使用 GitHub 或 Google 帐号登录。登录完成后根据提示信息填写一些基本的信息即可，注册完成后前往 &lt;a href="https://www.algolia.com/dashboard" target="_blank" rel="noopener">Dashboard&lt;/a>，我们可以发现 Algolia 会默认给我们生成一个 app。 &lt;img src="https://jimmysong.io/hugo-handbook/images/algolia-dashboard-index.jpg" alt="dashboard index">&lt;/p>
&lt;p>选择 Indices，添加一个新的索引，我们这里命名为&lt;code>qikqiak-blog&lt;/code>，创建成功后，我们可以看到提示中还没有任何记录。&lt;/p></description></item><item><title>漏斗图的变化</title><link>https://www.aliyisheng.blog/course/chapter1/%E8%BD%AE%E5%BB%93%E5%A2%9E%E5%BC%BA%E6%BC%8F%E6%96%97%E5%9B%BE2/</link><pubDate>Sun, 05 May 2019 00:00:00 +0100</pubDate><guid>https://www.aliyisheng.blog/course/chapter1/%E8%BD%AE%E5%BB%93%E5%A2%9E%E5%BC%BA%E6%BC%8F%E6%96%97%E5%9B%BE2/</guid><description>&lt;h2 id="说明">说明&lt;/h2>
&lt;p>漏斗图显示了x轴上观察到的效应大小或结果，与y轴上观察到的效应大小或结果的精度进行了比较。基于Sterne和Egger(2001)，y轴的推荐选择是标准误差(按降序)，这也是metafor包中漏斗()函数的默认设置。在没有发表偏差和异质性的情况下，人们可能会看到这些点形成漏斗形状，大多数点落入伪置信度区域内，界限为^θ±1.96SEθ^±1.96SE，其中^θθ^是基于固定效应模型估计的效果或结果，SESE是来自y轴的标准误差值。对于y轴的其他精度度量，漏斗的预期形状可能会有很大不同。下图显示了y轴的各种选择，以及这如何影响漏斗图的形状(以及伪置信度区域的形式)。&lt;/p>
&lt;h2 id="图例">图例&lt;/h2>
&lt;p>&lt;img src="https://i.loli.net/2021/03/11/KPFj32chEL8VRow.png" alt="img">&lt;/p>
&lt;h2 id="代码">代码&lt;/h2>
&lt;pre>&lt;code>library(metafor)
### fit fixed-effects model
res &amp;lt;- rma(yi, vi, data=dat.hackshaw1998, measure=&amp;quot;OR&amp;quot;, method=&amp;quot;FE&amp;quot;)
### set up 2x2 array for plotting
par(mfrow=c(2,2))
### draw funnel plots
funnel(res, main=&amp;quot;Standard Error&amp;quot;)
funnel(res, yaxis=&amp;quot;vi&amp;quot;, main=&amp;quot;Sampling Variance&amp;quot;)
funnel(res, yaxis=&amp;quot;seinv&amp;quot;, main=&amp;quot;Inverse Standard Error&amp;quot;)
funnel(res, yaxis=&amp;quot;vinv&amp;quot;, main=&amp;quot;Inverse Sampling Variance&amp;quot;)
&lt;/code>&lt;/pre>
&lt;h2 id="参考文献">参考文献&lt;/h2>
&lt;p>Sterne, J. A. C., &amp;amp; Egger, M. (2001). Funnel plots for detecting bias in meta-analysis: Guidelines on choice of axis. &lt;em>Journal of Clinical Epidemiology, 54&lt;/em>(10), 1046–1055.&lt;/p></description></item></channel></rss>