[R] how to calculate multiple meta p values
Ana Marija
@okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Sat Oct 26 01:32:20 CEST 2019
this is the function I was referring to:
https://www.rdocumentation.org/packages/metap/versions/1.1/topics/sumz
On Fri, Oct 25, 2019 at 6:31 PM Ana Marija <sokovic.anamarija using gmail.com> wrote:
>
> Hello,
>
> I would like to use this package metap
> to calculate multiple o values
>
> I have my data frame with 3 p values
> > head(tt)
> RS G E B
> 1: rs2089177 0.9986 0.7153 0.604716
> 2: rs4360974 0.9738 0.7838 0.430228
> 3: rs6502526 0.9744 0.7839 0.429160
> 4: rs8069906 0.7184 0.4918 0.521452
> 5: rs9905280 0.7205 0.4861 0.465758
> 6: rs4313843 0.9804 0.8522 0.474313
>
> and data frame with corresponding weights for each of the p values
> from the tt data frame
>
> > head(df)
> wg we wb RS
> 1 40.6325 35.39774 580.6436 rs2089177
> 2 40.6325 35.39774 580.6436 rs4360974
> 3 40.6325 35.39774 580.6436 rs6502526
> 4 40.6325 35.39774 580.6436 rs8069906
> 5 40.6325 35.39774 580.6436 rs9905280
> 6 40.6325 35.39774 580.6436 rs4313843
>
> RS column is the same in df and tt
>
> How to use this sunz() function to create a new data frame which would
> look the same as tt only it would have additional column, say named
> "META" which has calculated meta p values for each row
>
> This i s example of how much would be p value in the first row:
>
> > sumz(c(0.9986,0.7153,0.604716), weights = c(40.6325,35.39774,580.6436), na.action = na.fail)
> p = 0.6940048
>
> Thanks
> Ana
More information about the R-help
mailing list