RMSTmisclass: Estimate Treatment and Biomarker Effects on RMST in a...

View source: R/RMSTmisclass.R

RMSTmisclassR Documentation

Estimate Treatment and Biomarker Effects on RMST in a Biomarker Stratified Clinical Trial with Misclassification

Description

Estimate Treatment and Biomarker Effects on RMST in a Biomarker Stratified Clinical Trial with Misclassification

Usage

RMSTmisclass(dat, sens, spec, prev, tau)

Arguments

dat

the dataset that will be used to calculate estimates. The dataset needs to include columns called dtime and dstatus where dtime is time to event/censoring and dstatus is 1 if the participant had an event, 0 if they were censored. It also needs to include columns called trt (1 for treatment, 0 for control) and test (0 for those who tested negative for the biomarker, 1 for those who tested positive).

sens

the sensitivity of the biomarker test.

spec

the specificity of the biomarker test.

prev

the prevalence of the biomarker.

tau

restriction time for the RMST.

Value

a dataframe with estimated effects on RMST up to time tau, including treatment effects in the marker positive (M+) and negative (M-) groups, marker effects in the treatment (T+) and control (T-) groups, and the interaction effect (treatment effect in M+ group minus treatment effect in M- group). The dataframe also contains standard errors and p-values testing the null hypothesis that the difference in RMST = 0.

Examples

set.seed(23)
dat<- data.frame(trt = rep(0:1, each = 50), marker = rbinom(100, 1, prob = .3), cens = runif(100, 5, 15))
dat$ttime <- rexp(100, rate = exp(.1*dat$trt + .1*dat$marker - 0.7*dat$trt*dat$marker))
dat$dtime <- pmin(dat$ttime, dat$cens)
dat$dstatus <- (dat$ttime < dat$cens)
dat$test <- rbinom(100, 1, ifelse(dat$marker == 1, 0.8, 0.2))
RMSTmisclass(dat, sens=.8, spec=.8, prev=.3, tau = 10)

anneae/RMSTdesign documentation built on Nov. 7, 2023, 1:59 a.m.