View source: R/interactionR_boot.R
interactionR_boot | R Documentation |
Confidence intervals for interaction measures using bootstrapping as described by Assmann et al (1996).
interactionR_boot(
model,
ci.level = 0.95,
em = T,
recode = F,
seed = 12345,
s = 1000
)
model |
A fitted model object of class glm. Requires that the two binary exposure variables are listed first in the call formula. |
ci.level |
Magnitude of the returned CI level. Default is 0.95 |
em |
TRUE (the default), for effect modification assessment. FALSE, for interaction. |
recode |
If TRUE, recodes the exposures - if at least one of the exposures is protective - such that the stratum with the lowest risk becomes the new reference category when the two exposures are considered jointly. |
seed |
The random seed to use for generating the bootstrap samples for confidence intervals (for reproducibility). Default is 12345, but can be set to any number. |
s |
Number of bootstrap resampling. Default is 1000 |
a list object of class 'interactionR' that includes a dataframe containing all effect estimates necessary for full reporting of effect modification or interaction analysis. @seealso interactionR_table
for how to generate a publication-ready table from this object.
Assmann SF, Hosmer DW, Lemeshow S, Mundt KA. Confidence intervals for measures of interaction. Epidemiology 1996:286-90.
## Model fitting using dataset from assmann et al.
## The data is available in the package.
m <- glm(h ~ ns * smk,
family = binomial(link = "logit"),
data = HDiscdata
)
interactionR_boot(m,
ci.level = 0.95, em = FALSE, recode = FALSE,
seed = 12345, s = 1000
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.