Normalize: Unity-based normalization

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Normalizes as feature scaling min - max, or unity-based normalization typically used to bring the values into the range [0,1]. Other methods are also available, including scoring, centering, and Smithson and Verkuilen (2006) method of dependent variable transformation.

Usage

1
Normalize(x, method = "range", ...)

Arguments

x

is a vector to be normalized.

method

A string for the method used for normalization. Default is method = "range", which coerces values into [0,1] range. See details for other implemented methods.

...

Additional arguements (currently ignored).

Details

The following methods are available:

Value

Normalized values in an object of the same class as x.

Author(s)

Daniel Marcelino, dmarcelino@live.com

References

Smithson M, Verkuilen J (2006) A Better Lemon Squeezer? Maximum-Likelihood Regression with Beta-Distributed Dependent Variables. Psychological Methods, 11(1), 54-71.

See Also

scale.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
x <- sample(10)
(y = Normalize(x) )

# equivalently to
(x-min(x))/(max(x)-min(x))

# Smithson and Verkuilen approach
(y = Normalize(x, method="SV") )

# look at what happens to the correlation of two independent variables and their "interaction"
# With non-centered interactions:
a = rnorm(10000,20,2)
b = rnorm(10000,10,2)
cor(a,b)
cor(a,a*b)

# With centered interactions:
c = a - 20
d = b - 10
cor(c,c*d)

SciencesPo documentation built on May 29, 2017, 9:28 p.m.