rntransform {GenABEL} | R Documentation |
Rank-transformation to normality.
rntransform(var)
var |
Vector containing a variable to be transformed |
Rank-transformation to normality generates perfectly normal distribution from ANY distribution, unless many/heavy ties are present.
Vector containing transformed variable
Yurii Aulchenko
~~objects to See Also as help
, ~~~
# uniformly distributed variable x <- round(runif(200)*100) # get 7 missing values x[round(runif(7,min=1,max=100))] <- NA # transform y <- rntransform(x) # test normality of the original and transformed var shapiro.test(x) shapiro.test(y) # plot histogram par(mfcol=c(2,1)) hist(x) hist(y)