You should state from where 0.454 derives, i.e.:
qchisq(0.5, 1)
[1] 0.4549364
Actually, rounded up, it equates to 0.455
See my previous answer: Compute confidence intervals for lambda genomic factor statistics
Hi All,
Since I had a huge genetic data set, I divided it into 22 chunks (1 for each chromosome) and ran a logistic regression (case-control phenotype) adjusting for three covariates on each of the chunks. I have the PLINK outputs i.e. the assoc.logistic and assoc.logistic.adjusted files.
How do I calculate the genomic inflation factor for the entire dataset?
Thanks,
Debs
Plink calculates the genomic inflation factor:
plink --bfile hapmap1 --assoc --adjust --out as2
When the --adjust command is used, the log file records the inflation factor calculated for the genomic control analysis, and the mean chi-squared statistic (that should be 1 under the null):
Genomic inflation factor (based on median chi-squared) is 1.18739
Mean chi-squared statistic is 1.14813
If it is possible, you will have to merge all your files together before.
plink --file fA --merge-list allfiles.txt --make-bed --out mynewdata
Hope this would be help:
## Reads data
S <- read.table(input, header = FALSE)
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) / 0.454, 3)
lambda
You should state from where 0.454 derives, i.e.:
qchisq(0.5, 1)
[1] 0.4549364
Actually, rounded up, it equates to 0.455
See my previous answer: Compute confidence intervals for lambda genomic factor statistics
Log in to answer this question.
Wiki has an explanation on how to find the estimation of lambda
http://en.wikipedia.org/wiki/Population_stratification
Related posts:
Compute confidence intervals for lambda genomic factor statistics
https://stats.stackexchange.com/questions/110755/how-calculate-inflation-observed-and-expected-p-values-from-uniform-distribution