According to the Handbook of Biological Statistics, the arcsine squareroot transformation is used for proportional data, constrained at $-1$ and $1$. However, when I use transf.arcsine
in R
on a dataset ranging from $-1$ to $1$, NaNs are produced because of the square-rooting of a negative number. What is the correct way to transform this data - i.e. how do I use arcsine squareroot transformations on data which include negative numbers?
Arcsine squareroot transformation for data ranging from -$1$ to $1$
1
$\begingroup$
statistics
transformation
-
0It also says that "this is commonly used for proportions, which range from $0$ to $1$." – 2012-07-23
-
0That's right, it does. – 2012-07-23
-
0You can only apply $\arcsin(\sqrt{x})$ to numbers that lie on $[0,1]$. Or you can take $\arcsin(\mathrm{sgn}(x)\sqrt{|x|})$ (so take the square root of the absolute value, and then give it the same sign as $x$). – 2012-07-23
-
0[This post](http://stats.stackexchange.com/questions/10975/transforming-proportion-data-when-arcsin-square-root-is-not-enough) in the stat.SE site seems to suggest that the arcsine squareroot transformation is used for data which consists either of percentages or propotions, thus ensuring that it will lie in the desired (positive) range. – 2012-07-23
-
0Mmm, I have read a lot of references to its use with proportional data, but the mention in the BioStats handbook of the $[-1,1]$ use gave me hope there'd be a simple solution. – 2012-07-23
1 Answers
2
I used Arturo Magidin's formula, $\arcsin(\mathrm{sgn}(x)\sqrt{|x|})$ with the following R code:
trans.arcsine <- function(x){ asin(sign(x) * sqrt(abs(x))) } trans.arcsine(x)