interactionR_boot: Confidence intervals for interaction measures using...

View source: R/interactionR_boot.R

interactionR_bootR Documentation

Confidence intervals for interaction measures using bootstrapping as described by Assmann et al (1996).

Description

Confidence intervals for interaction measures using bootstrapping as described by Assmann et al (1996).

Usage

interactionR_boot(
  model,
  ci.level = 0.95,
  em = T,
  recode = F,
  seed = 12345,
  s = 1000
)

Arguments

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

Value

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.

References

Assmann SF, Hosmer DW, Lemeshow S, Mundt KA. Confidence intervals for measures of interaction. Epidemiology 1996:286-90.

Examples

## 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
)


interactionR documentation built on May 29, 2024, 1:21 a.m.