Skip to contents

Weighted conditional logistic regression for case-crossover with bootstrapped CIs

Usage

CXO_wt_boot(data, exposure, event, Id, tvc = NULL, B = 500, normal = TRUE)

Arguments

data

input dataframe

exposure

exposure variable

event

outcome variable

Id

person Id

tvc

name of time-varying confounder (optional)

B

number of bootstrapped replicates, default is 500. Minimum 200 recommended

normal

use normal approximation for bootstrapped CI, default is TRUE normal = F uses 2.5% and 97.% quantiles for 95% CI

Value

A list containing:

VariableParameter name
est0OR from weighted conditional logistic regression
estBootstrapped OR: mean if normal = T, median otherwise
lowerLower Bootstrapped 95% CI: using normal approximation if normal = T, 2.5th quantile otherwise
upperUpper Bootstrapped 95% CI: using normal approximation if normal = T, 97.5th quantile otherwise

Examples

data(cases)
try(CXO_wt_boot(data=cases, exposure=ex, event = Event, Id = Id, B=3))
#>     Variable     est0      est    lower    upper
#> ex1      ex1 1.399722 1.651831 1.454859 1.875472
# It is recommended that at least 500 bootstrap replications are used
if (FALSE) {

CXO_wt_boot(data=cases, exposure = ex, event = Event, Id = Id, B = 1000)
}