ez.zresidize: residualize variable, returning it changed in-place (i.e...

View source: R/stats.R

ez.zresidizeR Documentation

residualize variable, returning it changed in-place (i.e under its original column name)

Description

residualize variable, returning it changed in-place (i.e under its original column name)

Usage

ez.zresidize(data, var, covar, model = "lm", scale = TRUE, ...)

Arguments

var

a single var or a vector of var names to regress out covar

covar

covariates, one or more than one covar

model

'lm', 'lmrob' (MM-type Estimators, robustbase), 'lmRob' (automatically chooses, robust), 'rlm' (MASS)

scale

unstandarize or standardize residual

...

additional param passed to the specified model

Value

dataframe with var residualized in place (i.e under its original column name). If covar have NA, then that row for var will be NA.


jerryzhujian9/zmisc documentation built on March 9, 2024, 12:49 a.m.