residual_adjust: Perform residual adjustment on an epidemiologic variable

View source: R/residual_adjust.R

residual_adjustR Documentation

Perform residual adjustment on an epidemiologic variable

Description

Perform residual adjustment on an epidemiologic variable

Usage

residual_adjust(d, variable, confounder, label, verbose = FALSE)

Arguments

d

the input data frame on which to perform the adjustment

variable

character. Name of variable needing adjustment

confounder

character. Name of the confounder to adjust for

label

character. Name to give the adjusted variable

verbose

logical. Print updates to console?

Value

The original d object, with an extra column reflecting residual adjustments on the selected variable.

Examples

d <- data.frame(
  VARIABLE = rnorm(100, 10, 2),
  CONFOUNDER = rnorm(100, 3, 7)
)
result <- residual_adjust(d, "VARIABLE", "CONFOUNDER", "ADJUSTED")

head(d)
head(result)

PAutilities documentation built on Aug. 21, 2022, 9:05 a.m.