How to calculate arcsin (sgn (x) √ | x |)?

I am trying to use arcsine squareroot data lying on [-1,1] . Using transf.arcsine from the transf.arcsine package, you create NaNs when you try to squareroot negative data. Conceptually, I want to use arcsin(sgn(x)√|x|) i.e. square absolute value, apply its previous sign, and then arksin converts it. The trouble is that I have no idea how to start doing this in R. Help will be appreciated.

+4
source share
3 answers
 x <- seq(-1, 1, length = 20) asin(sign(x) * sqrt(abs(x))) 

or as a function

 trans.arcsine <- function(x){ asin(sign(x) * sqrt(abs(x))) } trans.arcsine(x) 
+13
source

The help in R is just help() or help.search() . So try the obvious

 > help(arcsin) No documentation for 'arcsin' in specified packages and libraries: 

Good, that’s not good. But he should be able to run ... try something even simpler.

 help(sin) 

There are all trigger functions. And I note that there is a link to Math on the page. Clicking seems to provide all the functions you need. Turns out I could just type ..

 help(Math) 

also,

 help.search('trigonometry') 
+4
source

I had a similar problem. I wanted arksin to convert most of the "logmeantd.ascvr" dataset and approach it like this:

The first make - the data range was converted to b / t -1 and 1 (in this case they were expressed as a percentage):

 logmeantd.ascvr[1:12] <- logmeantd.ascvr[1:12] * 0.01 

Then apply the square root function, sqrt ():

 logmeantd.ascvr[1:12] <- sqrt(logmeantd.ascvr[1:12]) 

Finally, apply the sine function of the arc, asin ():

 logmeantd.ascvr[1:12] <- asin(logmeantd.ascvr[1:12]) 

* note in this case I excluded the MEAN variable of my dataset because I wanted to apply the log function, log () to it:

  logmeantd.ascvr$MEAN <- log(logmeantd.ascvr$MEAN) 
0
source

All Articles