Weighted conditional logistic regression for case-crossover with bootstrapped CIs
Source:R/CXO_funcs.R
CXO_wt_boot.Rd
Weighted conditional logistic regression for case-crossover with bootstrapped CIs
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:
Variable | Parameter name |
est0 | OR from weighted conditional logistic regression |
est | Bootstrapped OR: mean if normal = T, median otherwise |
lower | Lower Bootstrapped 95% CI: using normal approximation if normal = T, 2.5th quantile otherwise |
upper | Upper 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)
}