Learn R Programming

expertsurv (version 1.4.1)

expertsurv-package: Incorporating Expert Opinion with Parametric Survival Models

Description

Contains functions to include expert opinion with the parametric models commonly used in health economic modelling. Theoretical details are described elsewhere Cooney.2023expertsurv. Borrows many functions from the survHE package Baio.2020expertsurv and flexsurv package flexsurvexpertsurv.

Arguments

Author

Philip Cooney Package Creator, Maintainer

Arthur White Thesis Supervisor

Details

Package:expertsurv
Type:Package
Version:1.4.0
Date:2023-09-22
License:MIT + file LICENSE
LazyLoad:yes

Integrate expert opinions on survival and mean differences in survival with common parametric survival models using either a Bayesian or frequentist framework.

References

P Cooney (2023). expertsurv: Incorporating expert opinion into parametric survival models.

Baio.2020expertsurv Cooney.2023expertsurv flexsurvexpertsurv

Examples

Run this code
#Define expert opinion
require("dplyr")
param_expert_example1 <- list()
#1 timepoint and 2 experts with equal weight,
#first a normal distribution, second a non-standard t-distribution with
#3 degrees of freedom

param_expert_example1[[1]] <- data.frame(dist = c("norm","t"),
                               wi = c(0.5,0.5), # Ensure Weights sum to 1
                               param1 = c(0.1,0.12),
                               param2 = c(0.05,0.05),
                                param3 = c(NA,3))


timepoint_expert <- 14

data2 <- data %>% rename(status = censored) %>% mutate(time2 = ifelse(time > 10, 10, time),
                  status2 = ifelse(time> 10, 0, status))

example1  <- fit.models.expert(formula=Surv(time2,status2)~1,data=data2,
                              distr=c("wph", "gomp"),
                              method="mle",
                              pool_type = "log pool", 
                              opinion_type = "survival",
                              times_expert = timepoint_expert, 
                              param_expert = param_expert_example1)

 #Visualize the goodness of fit
 model.fit.plot(example1, type = "aic")
 #Visualize the survival curve
 plot(example1, add.km = TRUE, t = 0:30)


Run the code above in your browser using DataLab