#R语言实现网状Meta
library(gemtc)
help(package="gemtc")
data<-gemtc::smoking #注意按照实例格式编写数据
net<-mtc.network(data$data.ab)
#网状图
plot(net,mode="circle",displaylabels=T,boxed.label=F)
summary(net)
#网状model
model<-mtc.model(net,type="consistency",#"consistency", "regression", "nodesplit", "ume", or "use")
n.chain=4,#Number of chains in the model
likelihood="binom",#The likelihood to be used. If unspecified, a suitable likelihood will be inferred for the given data.
link="logit",#The link function to be used. If unspecified, a suitable link function will be inferred for the given data.
linearModel="random")#"random" or "fixed"
#软件选取及迭代
result<-mtc.run(model,
sample="rjags",#采样方法"rjags"
n.adapt=20000,#自适应(或调整)迭代次数
n.iter=5000,#模拟迭代次数
thin=1)#间隔
summary(result)
#绘制森林图
forest(relative.effect(result,"A"))
#收敛诊断图
par(mfrow=c(2,2))
gelman.plot(result,auto.layout = F)
#轨迹和密度图
plot(result)
#排序图
ranks<-rank.probability(result)
sucra(ranks)
plot(ranks)
plot(ranks,beside=T)
#联赛表
liansai<-relative.effect.table(result)
library(xlsx)
write.xlsx(liansai,file="联赛图.xlsx")
#异质性检验
hererogeneity<-mtc.anohe(net)
hereo<-summary(hererogeneity)
plot(hereo)#敏感性分析森林图
文章来源:https://www.toymoban.com/news/detail-674335.html
文章来源地址https://www.toymoban.com/news/detail-674335.html
到了这里,关于R语言实现网状Meta分析(1)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!