
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 来建造的 
> se <-(metagen $ uci - metagen $ lci)/ (2*1.96)
Error in metagen$uci : 类别为'closure'的对象不可以取子集
> metagen <- read.xlsx("review.xlsx",13)
> se <-(metagen $ uci - metagen $ lci)/ (2*1.96)
> lnhr<- log(metagen$ hr)
> metagen <- cbind(metagen,lnhr,se)
> m <- metagen(TE=metagen$lnhr,seTE=metagen$se,studlab=paste(metagen$study,metagen$year,sep = "/"),sm="HR",backtransf=TRUE,byvar=metagen$design)
> m
Number of studies: k = 16

                         HR           95%-CI     z  p-value
Common effect model  1.8818 [1.6940; 2.0905] 11.78 < 0.0001
Random effects model 1.7681 [1.4286; 2.1883]  5.24 < 0.0001

Quantifying heterogeneity:
 tau^2 = 0.0568 [0.0000; 0.1211]; tau = 0.2383 [0.0000; 0.3479]
 I^2 = 45.1% [1.3%; 69.4%]; H = 1.35 [1.01; 1.81]

Test of heterogeneity:
     Q d.f. p-value
 27.30   15  0.0264

Results for subgroups (common effect model):
                         k     HR           95%-CI     Q   I^2
design = Retrospective  12 1.8438 [1.6545; 2.0549] 24.87 55.8%
design = Prospective     4 2.6125 [1.6915; 4.0350]  0.10  0.0%

Test for subgroup differences (common effect model):
                   Q d.f. p-value
Between groups  2.32    1  0.1274
Within groups  24.97   14  0.0348

Results for subgroups (random effects model):
                         k     HR           95%-CI  tau^2    tau
design = Retrospective  12 1.6471 [1.3056; 2.0780] 0.0569 0.2385
design = Prospective     4 2.6125 [1.6915; 4.0350]      0      0

Test for subgroup differences (random effects model):
                  Q d.f. p-value
Between groups 3.36    1  0.0666

Details on meta-analytical method:
- Inverse variance method
- Restricted maximum-likelihood estimator for tau^2
- Q-Profile method for confidence interval of tau^2 and tau
> 
