regEff | R Documentation |
A function to regress out the effect a confounding variable on a dependent variable.
regEff(data, ..., d.var, c.var)
data |
A data frame output from any easyXpress function used after the |
... |
<[rlang::'dyn-dots']> Variable(s) used to group the data prior to regression. Variable names can be listed in succession. For example, |
d.var |
The dependent variable to use in the linear model. Supply the variable without quotes. For example, |
c.var |
The confounding variable to use in the linear model. Supply the variable without quotes. For example, |
A list including four elements.
1) A data frame, <out>$d
, with three variables added. These include, <d.var>_reg
,
<c.var>_reg_coeff
, and <c.var>_reg_sig
.
2) A diagnostic plot, <out>$p1
, showing the effect of the confounding variable (c.var
) on the dependent variable (d.var
).
3) A diagnositc plot, <out>$p2
, showing the regression coefficients of the confounding variable (c.var
) on the y-axis and the dependent variable (d.var
) on the x-axis.
4) A list, <out>$models
of model objects for each group.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.