Learn R Programming

parameters (version 0.1.0)

standardize.lm: Model Standardization

Description

Refit the model after standardizing the data.

Usage

# S3 method for lm
standardize(x, robust = FALSE, method = "default",
  verbose = TRUE, ...)

Arguments

x

Object.

robust

Logical, if TRUE, centering is done by substracting the median from the variables and divide it by the median absolute deviation (MAD). If FALSE, variables are standardized by substracting the mean and divide it by the standard deviation (SD). the

method

The method of standardization. For data.frames, can be "default" (variables are divided by SD or MAD depending on robust) or "2sd" (divided by two times the deviation).

verbose

Toggle warnings on or off.

...

Arguments passed to or from other methods.

Value

The model fitted on standardized data.

Examples

Run this code
# NOT RUN {
model <- lm(Sepal.Length ~ Species * Petal.Width, data = iris)
coef(standardize(model))
# }

Run the code above in your browser using DataLab