zkutalik / ssimp_software

GNU General Public License v3.0
16 stars 10 forks source link

R function to calculate P value #28

Closed drveera closed 6 years ago

drveera commented 6 years ago

Hi,

Could you tell how to calculate P values using R? For now I am doing like, pnorm(abs(Z), lower.tail=FALSE) Is this right? I couldnt understand the formula you described in the manual.

Regards, Veera

drveera commented 6 years ago

I guess its pnorm(abs(Z), lower.tail=FALSE)*2.

sinarueeger commented 6 years ago

Correct! In case of super large z stats (as often in genomics) you might want to use the log option too. Otherwise you end up with p=0.

drveera commented 6 years ago

Sure. thanks. Also regarding the lambda I didnt specify anything. Whats the default value the script uses? does it calculated from sample size from reference panel?

sinarueeger commented 6 years ago

The default lambda (2/sqrt(n)) is fine. And yes, n is the number of individuals in the refpanel.

sinarueeger commented 6 years ago

The newest version (just uploaded) has the P value column included.

drveera commented 6 years ago

awesome. thanks :)