getScaleCoef: Extract scaling coefficients from vector returned by...

View source: R/getScaleCoef.R

getScaleCoefR Documentation

Extract scaling coefficients from vector returned by scale()

Description

The function scale() replaces x by (x-a)/b, where a is mean(x) and b is sd(x). The quantities a and b are available as attributes of the object that is returned.

Usage

getScaleCoef(z)

Arguments

z

Object returned by scale()

Details

Use of a scaled explanatory variable can be helpful in getting a model to fit. The scaling coefficient(s) will then be needed when the fitted model is used with explanatory variable values on the original scale.

Value

A vector, whose elements are the scaling coefficients a and b, or if scale=FALSE then a.

Examples

z <- scale(1:10)
qra::getScaleCoef(z)

jhmaindonald/qra-R-package documentation built on Nov. 16, 2023, 2:39 p.m.