Rライブラリの探索5(臨床試験)
今日はclinical trialsのグループのパッケージをやりました。
絵的に見て面白いものが多かったです。見慣れたものも多いし。
使えそうだった絵を貼っていきます。
- Tukeyの多重性調整
- 線形モデル、分散分析(ggplot2でも描けそう)
- 有害事象のプロット
- 時系列プロット(この例はCO2)
- フォレストプロット
- ファンネルプロット
- L'Abbeプロット
L'Abbeプロットは初めてみた。
試験の規模を丸で表して、対照群と試験群をプロットしてるんだろうね。
Rコードはこちら↓
library(HH)
example(F.curve)
example(norm.curve)
example(interaction2wt) #交互作用の表示(あんまり綺麗じゃないから参考にしつつggplot2で描いた方がよさそう)
example(mmc) #multiple comparison
#Tukeyの多重性調整
catalystm <- read.table(hh("datasets/catalystm.dat"), header=FALSE,
col.names=c("catalyst","concent"))
catalystm$catalyst <- factor(catalystm$catalyst, labels=c("A","B","C","D"))
catalystm1.aov <- aov(concent ~ catalyst, data=catalystm)
catalystm.mmc <-
if.R(r=glht.mmc(catalystm1.aov, linfct = mcp(catalyst = "Tukey")),
s=multicomp.mmc(catalystm1.aov, plot=FALSE))
if.R(s=plot(catalystm.mmc, x.offset=1),
r=plot(catalystm.mmc, ry=c(50,58), x.offset=1.8))
example(ancova) #様々なモデル化をしたときのパラメータの変化を見る
example(intxplot) #交互作用のプロット
example(ladder)
example(plot.multicomp) #多重性調整の信頼区間
example(ae.dotplot) #有害事象のプロット
example(ci.plot) #信頼区間と予測区間のプロット
example(odds.ratio) #ROCっぽい図?
example(partial.corr) #偏相関係数
example(plot.mmc.multicomp) #多重性調整のプロット
example(residual.plots)
example(seqplot) #時系列プロット
example(tsacfplots)
example(if.R) #RとS-Plusの分岐
library(meta) #メタアナリシス
example(forest) #Forest plot
example(funnel) #Funnel plot
example(labbe) #L'Abbe plot
example(trimfill) #trim and fill method
#Forest plot
data(Olkin95)
meta1 <- metabin(event.e, n.e, event.c, n.c,
data=Olkin95, subset=c(41,47,51,59),
sm="RR", meth="I",
studlab=paste(author, year))
forest(meta1)
#Funnel plot
#Galbraith RF (1988b), A note on graphical presentation of estimated odds ratios from several clinical trials. Statistics in Medicine, 7, 889?894.
funnel(meta1, comb.fixed=TRUE,
level=0.95, contour=c(0.9, 0.95, 0.99),
col.contour=c("darkgreen", "green", "lightgreen"),
lwd=2, cex=2, pch=16, studlab=TRUE, cex.studlab=1.25)
legend(0.05, 0.05,
c("0.1 > p > 0.05", "0.05 > p > 0.01", "< 0.01"),
fill=c("darkgreen", "green", "lightgreen"))
#L'Abbe plot
#L’Abbe KA, Detsky AS, O’Rourke K (1987), Meta-analysis in clinical research. Annals of Internal Medicine, 107, 224?233.
labbe(meta1)






