knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of metaSurvival is to perform Meta-analysis of a single survival curve using the multivariate methodology of DerSimonian and Laird.
You can install the released version of metaSurvival from CRAN with:
install.packages("metaSurvival")
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("shubhrampandey/metaSurvival")
library(metaSurvival)
First start with loading the example dataset.
data(exampleData) attach(exampleData) head(exampleData)
Computation of summary survival with continuity correction.
results<-msurv(Study, Time, NbRisk, Survival, confidence="Greenwood",correctionFlag = T,correctionVal = c(0.25,0.5)) results
Plot the estimates summary survival
RandomEffectSummary<- results$summary.random plot(Time, Survival, type="n", col="grey", ylim=c(0,1),xlab="Time", ylab="Survival") for (i in unique(sort(Study))){ lines(Time[Study==i], Survival[Study==i], type="l", col="grey") points(max(Time[Study==i]), Survival[Study==i & Time==max(Time[Study==i])], pch=15) } lines(RandomEffectSummary[,1], RandomEffectSummary[,2], type="l", col="red", lwd=3) points(RandomEffectSummary[,1], RandomEffectSummary[,3], type="l", col="red", lty=3, lwd=3) points(RandomEffectSummary[,1], RandomEffectSummary[,4], type="l", col="red", lty=3, lwd=3)
Computation of summary survival without continuity correction.
results<-msurv(Study, Time, NbRisk, Survival, confidence="Greenwood",correctionFlag = F) results
Plot the estimates summary survival
RandomEffectSummary<- results$summary.random plot(Time, Survival, type="n", col="grey", ylim=c(0,1),xlab="Time", ylab="Survival") for (i in unique(sort(Study))){ lines(Time[Study==i], Survival[Study==i], type="l", col="grey") points(max(Time[Study==i]), Survival[Study==i & Time==max(Time[Study==i])], pch=15) } lines(RandomEffectSummary[,1], RandomEffectSummary[,2], type="l", col="red", lwd=3) points(RandomEffectSummary[,1], RandomEffectSummary[,3], type="l", col="red", lty=3, lwd=3) points(RandomEffectSummary[,1], RandomEffectSummary[,4], type="l", col="red", lty=3, lwd=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.