https://cran.r-project.org/
https://rstudio.com/products/rstudio/download/
install.packages("survHE") #zainstaluj pakiet przed pierwszym użyciem
library(survHE) #wczytaj pakiet każdorazowo po nowym uruchomieniu środowiskaFunkcje pomocnicze
Dostęp do szczegółowego opisu funkcji zapewnia funkcjia help() lub znak zapytania postawiony przed nazwą funkcji
Operatory przypisania
Nazwy dla obiektów będących wynikami zastosowanej funkcji nadajemy używając operatora <= lub =
Odwołanie do elementów obiektu
Dostep do elemntów utworzonego obiektu (np. kolumn lub tabel) zapewnia użycie znaku dolara na końcu nazwy obiektu
Zapisywanie danych
Funkcja rmst2() przeprowadza porównania dwóch prób przy użyciu ograniczonego średniego czasu przeżycia (RMST). Obliczane są trzy miary:
formula <- Surv(time, status) ~ as.factor(treat)
mods <- c("exp", "weibull", "gamma", "lnorm", "llogis", "gompertz")
Distribution <- c("Expotential", "Weibulls", "Gamma", "Log normal","Log-logistic","Gompertz")
m1 <- fit.models(formula = formula,
data = ipd_daurismo,
distr = mods)
models - wynik analizy
model.fitting - wynik AIC i BIC
Estimated average survival time distribution*
mean sd 2.5% median 97.5%
as.factor(treat)=0 11.962412 1.2136954 9.637701 11.942020 14.385323
as.factor(treat)=1 5.413511 0.9172816 3.839308 5.359219 7.361374
*Computed over the range: [ 0.1328-33.0880] using 1000 simulations.
NB: Check that the survival curves tend to 0 over this range!
Wizualna ocena dopasowania rozkładów parametrycznych
plot(m1,
add.km = T,
lab.profile = c("Daurismo","Komparator"),
ylab = "Prawdopodobieństwo \nprzeżycia",
xlab = "Czas (miesiącach)") +
theme_survminer()+
theme(legend.direction = "horizontal")+
theme(legend.text = element_text(size = 13),
legend.title = element_text(size = 13))Ocena dopasowania na podstawie kryterium informacyjnego
aic_plot <- model.fit.plot(MLE = m1, colour = "deepskyblue4",
stacked = T,
scale = "relative",
type = "aic",
name_legend = "Zastosowana metoda",
labs(title = "Test AIC"))+
theme_half_open()+
theme(legend.position = "null")+
labs(title = "")+
xlab(label = "")
bic_plot <- model.fit.plot(MLE =m1,
colour = "deepskyblue4",
stacked = T,
scale = "relative",
type = "bic",
name_legend = "Zastosowana metoda",
labs(title = "Test AIC"))+
theme_half_open()+
theme(legend.position = "null")+
labs(title = "")+
xlab(label = "")
flexplot <- plot_grid(aic_plot, bic_plot, ncol = 2)
flexplotPropabilistyczna analiza wrażliwości
plot(m1, mods=c(4,5),
nsim = 1000,
t = seq(.1, 63),
colour = c("deepskyblue4", "aquamarine3"),
add.km = T,
lab.profile = c("Daurismo","Komparator"),
ylab = "Prawdopodobieństwo \nprzeżycia",
xlab = "Czas (miesiącach)") +
theme_survminer()+
theme(legend.direction = "horizontal")+
theme(legend.text = element_text(size = 13),
legend.title = element_text(size = 13))Ekstrapolacja
plot(m1, mods = c(1,2,3,4,5,6), add.km = T,
nsim = 1000, t = seq(.1, 200),
lab.profile = c("Daurismo","Komparator"),
annotate = T,
legend.title = element_text(size = 15, face = "bold"),
legend.text = element_text(size = 15, face = "plain"),
ylab = "Prawdopodobieństwo \nprzeżycia",
xlab = "Czas (miesiącach)")
https://cran.r-project.org/
https://rstudio.com/products/rstudio/download/
install.packages("survHE") #zainstaluj pakiet przed pierwszym użyciem
library(survHE) #wczytaj pakiet każdorazowo po nowym uruchomieniu środowiskaformula <- Surv(time, status) ~ as.factor(treat)
mods <- c("exp", "weibull", "gamma", "lnorm", "llogis", "gompertz")
Distribution <- c("Expotential", "Weibulls", "Gamma", "Log normal","Log-logistic","Gompertz")
m1 <- fit.models(formula = formula,
data = ipd_daurismo,
distr = mods) aic_plot <- model.fit.plot(MLE = m1, colour = "deepskyblue4",
stacked = T,
scale = "relative",
type = "aic",
name_legend = "Zastosowana metoda",
labs(title = "Test AIC"))+
theme_half_open()+
theme(legend.position = "null")+
labs(title = "")+
xlab(label = "")
bic_plot <- model.fit.plot(MLE =m1,
colour = "deepskyblue4",
stacked = T,
scale = "relative",
type = "bic",
name_legend = "Zastosowana metoda",
labs(title = "Test AIC"))+
theme_half_open()+
theme(legend.position = "null")+
labs(title = "")+
xlab(label = "")
flexplot <- plot_grid(aic_plot, bic_plot, ncol = 2)
flexplotplot(m1, mods=c(4,5),
nsim = 1000,
t = seq(.1, 63),
colour = c("deepskyblue4", "aquamarine3"),
add.km = T,
lab.profile = c("Daurismo","Komparator"),
ylab = "Prawdopodobieństwo \nprzeżycia",
xlab = "Czas (miesiącach)") +
theme_survminer()+
theme(legend.direction = "horizontal")+
theme(legend.text = element_text(size = 13),
legend.title = element_text(size = 13))plot(m1, mods = c(1,2,3,4,5,6), add.km = T,
nsim = 1000, t = seq(.1, 200),
lab.profile = c("Pola+Br","Br"),
annotate = T,
legend.title = element_text(size = 15, face = "bold"),
legend.text = element_text(size = 15, face = "plain"),
ylab = "Prawdopodobieństwo \nprzeżycia",
xlab = "Czas (miesiącach)")Nice dsu technical support document 14. Survival analysis for economic evaluations Alongside clinical trials - extrapolation with Patient-level data - http://nicedsu.org.uk/wp-content/uploads/2016/03/NICE-DSU-TSD-Survival-analysis.updated-March-2013.v2.pdf
Gianluca Baio. survHE: Survival Analysis for Health Economic Evaluation and Cost-Effectiveness Modeling - https://www.jstatsoft.org/article/view/v095i14/v95i14.pdf
A. Health, I Manolopoulou, G Baio. Estimating the expected value of partial perfect information in health economic evaluations using Integrated Nested Laplace Approximation - http://www.statistica.it/gianluca/publication/heathetal-2016/
-A. Health, I Manolopoulou, G Baio Efficient Monte Carlo Estimation of the Expected Value of Sample Information Using Moment Matching - https://journals.sagepub.com/doi/10.1177/0272989X17738515