[R] function for inverse normal transformation

carol white wht_crl at yahoo.com
Fri Jul 20 13:59:14 CEST 2012


I have a continuous data. So to calculate the inverse normal transformation, I thought that I should first calculate the Z-score normalized data and then, calculate the p-value et the quantile transformation. Does this seem to be more sensible


my_data.p =2*pnorm(abs(scale(my_data)),lower.tail=FALSE)
my_data.q= qnorm(my_data.p)


The attached file shows the histogram of a small data set before transformation, the p-value generated from the Z-score normalized data and then, the qnorm-transformed data.

Thanks for your feedback,


________________________________
 From: Duncan Murdoch <murdoch.duncan at gmail.com>
To: carol white <wht_crl at yahoo.com> 
Cc: "r-help at stat.math.ethz.ch" <r-help at stat.math.ethz.ch> 
Sent: Friday, July 20, 2012 1:42 PM
Subject: Re: [R] function for inverse normal transformation
 
On 12-07-20 7:36 AM, carol white wrote:
> Thanks for your reply.
>
> So to derive it from a given data set, is the following correct to do?
>
> my_data.p =2*pnorm(abs(my_data),lower.tail=FALSE)
>
> my_data.q = qnorm(my_data.p)

I don't know what you're trying to do, but that doesn't look like it 
does something sensible.  It would take a value like 2, compute the p to 
be 0.045, and return the corresponding quantile of the normal 
distribution, i.e. -1.69 or so.  I don't know why you'd want to do that.

Duncan Murdoch

>
> Cheers,
>
>
> ________________________________
>   From: Duncan Murdoch <murdoch.duncan at gmail.com>
> To: carol white <wht_crl at yahoo.com>
> Cc: "r-help at stat.math.ethz.ch" <r-help at stat.math.ethz.ch>
> Sent: Friday, July 20, 2012 1:23 PM
> Subject: Re: [R] function for inverse normal transformation
>
> On 12-07-20 6:21 AM, carol white wrote:
>> Hi,
>> What is the function for inverse normal transformation?
>
> qnorm
>
> Duncan Murdoch
>
>> Thanks,
>>
>> Carol
>>
>>      [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp.png
Type: image/png
Size: 16620 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120720/d5ed78bd/attachment.png>


More information about the R-help mailing list