View source: R/residual_adjust.R
residual_adjust | R Documentation |
Perform residual adjustment on an epidemiologic variable
residual_adjust(d, variable, confounder, label, verbose = FALSE)
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? |
The original d
object, with an extra column reflecting
residual adjustments on the selected variable.
d <- data.frame( VARIABLE = rnorm(100, 10, 2), CONFOUNDER = rnorm(100, 3, 7) ) result <- residual_adjust(d, "VARIABLE", "CONFOUNDER", "ADJUSTED") head(d) head(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.