INT: INT

Description Usage Arguments Details Value Author(s) Examples

View source: R/aveytoolkit_INT.R

Description

INT INT performs an inverse normal transformation

Usage

1
2
3
4
5
6
INT(
  x,
  na.last = "keep",
  ties.method = c("average", "first", "last", "random", "max", "min"),
  ...
)

Arguments

x

numeric vector to be transformed

na.last

How NA values should be handled. Passed to rank.

ties.method

How ties should be handled. Passed to rank.

...

Other arguments passed to qnorm

Details

Takes an input vector and performs a rank-based inverse normal transformation (making the data approximately normally distributed. Positions with missing (NA) values will be returned as NA by default (see 'na.last')

Value

A numeric vector containing the transformed values of x.

Author(s)

Stefan Avey

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Normally Distributed data
x1 <- rnorm(100)
hist(INT(x1)) # still normally distributed
hist(INT(x1, mean = 10, sd = 2)) # still normally distributed

## Uniformly Distributed data
x2 <- runif(100)
hist(INT(x2)) # forced to be normally distributed by rank

## Many ties in data, different methods for handling ties
x3 <- rep(10:20, 5)
hist(INT(x3, ties.method = "average"))
hist(INT(x3, ties.method = "first"))
hist(INT(x3, ties.method = "max"))

stefanavey/aveytoolkit documentation built on March 5, 2020, 12:49 a.m.