fit<-metabin(dat$e.e,dat$e.tot,dat$c.e,dat$c.tot, data=dat,
? ? ? ? ? ? ? sm="RR", method="MH", comb.fixed=T,
? ? ? ? ? ? ? comb.random=F,studlab=dat$lab)
Error in (function (yi, vi, sei, weights, ai, bi, ci, di, n1i, n2i, x1i, :
? Fisher scoring algorithm did not converge. See 'help(rma)' for possible remedies.
數(shù)據(jù)無法估計,有兩種方法解決
第一種:采用stata軟件 重新估計,不會報錯
第二種:換用metafor的rma包,但是rma包繪制的森林圖不如meta包繪制的精美,需要手手動調(diào)整,同時,若估計固定效應(yīng),rma.mh估計結(jié)果與stata一致
dt.1<-rma.mh(measure="RR", ai=e.e, bi=e.tot-e.e,
? ? ? ? ? ci=c.e, di=c.tot-c.e,n1i=e.tot,n2i = c.tot,
? ? ? ? ? data=dat, method="FE",? #固定效應(yīng)
? ? ? ? ? slab = dat$lab
? ? ? ? ? )
森林圖繪制
forest(dt.1,
? ? ? atransf=exp, #轉(zhuǎn)換成RR
? ? ? slab=dat$lab,
? ? ? ilab.xpos = c(-1.1,-0.8,-0.5,-0.2),? #位置參數(shù)
? ? ? ilab = cbind(e.e,e.tot,c.e,c.tot),? #event total controlevent control total
? ? ? showweights=T,
? ? ? header = F,
? ? ? xlab = "",
? ? ? mlab = "Fixed-effect Model for All Studies",
? ? ? psize = 1
? ? )
text(c(-1.6,-1.1,-0.8,-0.5,-0.2,1.5,2), #X位置
? ? dt.1$k+2,? ? ? ? ? ? ? ? #Y軸位置
? ? c("Study", "Events", "Total", "Events", "Total",
? ? ? "Weight","RR 95%-CI"),
? ? cex=1.2,font = 2)
text(c(-0.9,-0.4),? ?
? ? dt.1$k+3,
? ? c("Experimental", "Control"),? ?
? ? cex=1.2, font=2)
