residual_adjust {PAutilities} | R 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)
[Package PAutilities version 1.2.1 Index]