ch.altRootTransform: A function to transform a variable that contains 0s and/or...

ch.altRootTransformR Documentation

A function to transform a variable that contains 0s and/or negatives, while retaining ordinality, 0==0, and symmetry of influence around 0

Description

This function transforms a variable as follows: x.out <- ifelse(x>0, x^(1/root), -1*abs(x)^(1/root)). This transformation compresses numbers that are a large distance from zero (both positive and negative).

Usage

ch.altRootTransform(x, root = 4)

Arguments

x

a numeric vector.

root

a number indicating the root that x will be taken to (e.g., 2 = sqrt; 4=cubed root; etc.). DEFAULT = 4.

Value

a vector of transformed numbers.

Examples

ch.altRootTransform (myX)

ccpluncw/ccpl_R_chutils documentation built on Feb. 28, 2024, 1:17 a.m.