Skip to content

Instantly share code, notes, and snippets.

@marcora
Created January 26, 2016 22:21
Show Gist options
  • Save marcora/30596ca17d0393dacf04 to your computer and use it in GitHub Desktop.
Save marcora/30596ca17d0393dacf04 to your computer and use it in GitHub Desktop.
## Reads data
S <- read.table(input,header=F)
if (stat_type == "Z")
z=S[,1]
if (stat_type == "CHISQ")
z=sqrt(S[,1])
if (stat_type == "PVAL")
z=qnorm(S[,1]/2)
## calculates lambda
lambda = round(median(z^2)/.454,3)
lambda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment