
R version 4.2.2 (2022-10-31 ucrt) -- "Innocent and Trusting"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R是自由软件，不带任何担保。
在某些条件下你可以将其自由散布。
用'license()'或'licence()'来看散布的详细条件。

R是个合作计划，有许多人为之做出了贡献.
用'contributors()'来看合作者的详细情况
用'citation()'会告诉你如何在出版物中正确地引用R或R程序包。

用'demo()'来看一些示范程序，用'help()'来阅读在线帮助文件，或
用'help.start()'通过HTML浏览器来看帮助文件。
用'q()'退出R.

[原来保存的工作空间已还原]

> library(xlsx)
> library(meta)
载入需要的程辑包：metadat
Loading 'meta' package (version 7.0-0).
Type 'help(meta)' for a brief overview.
Readers of 'Meta-Analysis with R (Use R!)' should install
older version of 'meta' package: https://tinyurl.com/dt4y5drs
Warning messages:
1: 程辑包‘meta’是用R版本4.2.3 来建造的 
2: 程辑包‘metadat’是用R版本4.2.3 来建造的 
> library(metafor)
载入需要的程辑包：Matrix
载入需要的程辑包：numDeriv

Loading the 'metafor' package (version 4.2-0). For an
introduction to the package please type: help(metafor)

An updated version of the package (version 4.4-0) is available!
To update to this version type: install.packages("metafor")

Warning message:
程辑包‘metafor’是用R版本4.2.3 来建造的 
> metagen <- read.xlsx("metaregression.xlsx",1)
> se <-(metagen $ uci - metagen $ lci)/ (2*1.96)
> lnhr<- log(metagen$ hr)
> metagen <- cbind(metagen,lnhr,se)
> res <- rma(yi=lnhr,sei=se,method="REML",mods=Followupperiod,data=metagen)
> res

Mixed-Effects Model (k = 16; tau^2 estimator: REML)

tau^2 (estimated amount of residual heterogeneity):     0.0402 (SE = 0.0491)
tau (square root of estimated tau^2 value):             0.2006
I^2 (residual heterogeneity / unaccounted variability): 31.71%
H^2 (unaccounted variability / sampling variability):   1.46
R^2 (amount of heterogeneity accounted for):            22.40%

Test for Residual Heterogeneity:
QE(df = 14) = 15.6411, p-val = 0.3358

Test of Moderators (coefficient 2):
QM(df = 1) = 1.1215, p-val = 0.2896

Model Results:

         estimate      se    zval    pval    ci.lb   ci.ub    
intrcpt    0.3507  0.1986  1.7656  0.0775  -0.0386  0.7400  . 
mods       0.0375  0.0354  1.0590  0.2896  -0.0319  0.1069    

---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

> 
