percent_confint {marp}R Documentation

A function to calculate percentile bootstrap confidence interval

Description

A function to calculate percentile bootstrap confidence interval

Usage

percent_confint(data, B, t, m, y, which.model = 1)

Arguments

data

input inter-event times

B

number of bootstrap samples

t

user-specified time intervals (used to compute hazard rate)

m

the number of iterations in nlm

y

user-specified time point (used to compute time-to-event probability)

which.model

user-specified generating (or true underlying if known) model

Value

returns list of percentile bootstrap intervals (including the model-averaged approach).

weights_bstp

Model weights calculated by bootstrapping, that is, the frequency of each model being selected as the best model is divided by the total number of bootstraps

mu_gen

Median of the percentile bootstrap confidence interval of the estimated mean based on the generating model

mu_gen_lower

Lower limit of the percentile bootstrap confidence interval of the estimated mean based on the generating model

mu_gen_upper

Upper limit of the percentile bootstrap confidence interval of the estimated mean based on the generating model

mu_best

Median of the percentile bootstrap confidence interval of the estimated mean based on the best model

mu_best_lower

Lower limit of the percentile bootstrap confidence interval of the estimated mean based on the best model

mu_best_upper

Upper limit of the percentile bootstrap confidence interval of the estimated mean based on the best model

pr_gen

Median of the percentile bootstrap confidence interval of the estimated probabilities based on the generating model

pr_gen_lower

Lower limit of the percentile bootstrap confidence interval of the estimated probabilities based on the generating model

pr_gen_upper

Upper limit of the percentile bootstrap confidence interval of the estimated probabilities based on the generating model

pr_best

Median of the percentile bootstrap confidence interval of the estimated probabilities based on the best model

pr_best_lower

Lower limit of the percentile bootstrap confidence interval of the estimated probabilities based on the best model

pr_best_upper

Upper limit of the percentile bootstrap confidence interval of the estimated probabilities based on the best model

haz_gen

Median of the percentile bootstrap confidence interval of the estimated hazard rates based on the generating model

haz_gen_lower

Lower limit of the percentile bootstrap confidence interval of the estimated hazard rates based on the generating model

haz_gen_upper

Upper limit of the percentile bootstrap confidence interval of the estimated hazard rates based on the generating model

haz_best

Median of the percentile bootstrap confidence interval of the estimated hazard rates based on the best model

haz_best_lower

Lower limit of the percentile bootstrap confidence interval of the estimated hazard rates based on the best model

haz_best_upper

Upper limit of the percentile bootstrap confidence interval of the estimated hazard rates based on the best model

Examples


# generate random data
set.seed(42)
data <- rgamma(30, 3, 0.01)

# set some parameters
m <- 10 # number of iterations for MLE optimization
t <- seq(100,200,by=10) # time intervals
y <- 304 # cut-off year for estimating probablity
B <- 100 # number of bootstraps
BB <- 100 # number of double bootstraps
which.model <- 2 # specify the generating model

# construct percentile bootstrap confidence invtervals
marp::percent_confint(data, B, t, m, y, which.model)



[Package marp version 0.1.0 Index]