【发布时间】:2020-05-06 10:17:52
【问题描述】:
我是 R 的初学者。我需要您的帮助来自动执行这些分析并获得带有结果的摘要输出。
我有 4 个像这样的不同数据框(见下文),在阈值列中具有相同的标题和相同的值:
Set Threshold R2 P Coefficient Standard.Error Num_SNP
Base 0.0001 0.000233304 0.66047 0.0332613 0.0757204 47
Base 0.001 0.000387268 0.571772 -0.0438782 0.0775996 475
Base 0.05 0.00302399 0.114364 0.129474 0.082004 14164
Base 0.1 0.00252797 0.14897 0.117391 0.0813418 24616
Base 0.2 0.00481908 0.0465384 0.163571 0.0821767 41524
Base 0.3 0.00514761 0.0398082 0.170058 0.0827237 55307
Base 0.4 0.00699506 0.0166685 0.200571 0.083783 66943
Base 0.5 0.00634181 0.0226301 0.192314 0.0843623 76785
对于阈值列中的每个匹配值,我想使用 R 中的包 metafor 对 4 个数据帧的相应效应大小(在系数列中)和标准误差进行元分析。
使用 metafor 包:
rma.uni(yi=c(Coefficient_1,Coefficient_2,Coefficient_3,Coefficient_4),sei=c(Standard.Error_1,Standard.Error_2,Standard.Error_3,Standard.Error_4), measure="GEN", method='FE',intercept=T,weights=c(sample_size1,sample_size2,sample_size3,sample_size4))
如何自动执行分析并获得包含每个阈值结果的摘要数据框?
【问题讨论】:
标签: r loops data-analysis metafor