Hello,
I've been using Plink 1.9 to perform an association analysis and trying to replicate my results in R then.
Firstly, I performed an association analysis with the --assoc flag:
plink --bfile SNPs --pheno AER_max.phenotype --all-pheno --allow-no-sex --assoc --out assoc_results
My phenotype file only contains one phenotype (quantitative).
When I ran my code in R, I used a linear model (lm(AER_max ~ SNPs, data = df)), obtaining the same results as using PLINK.
After that, I introduced two covariables and applied the --linear flag:
plink
--bfile SNPs --pheno
AER_max.phenotype --all-pheno --allow-no-sex --covar covars.txt --linear
--out linear_results
Again,
I ran the code in R to get the same results. In this case, I used a
linear mixed model, to establish the covariables (Age and Gender) as
random effects.
lmer(AER_max ~ SNPs + (1|Age) + (1|Gender), data = df). The
results for that analysis are slightly different than the ones obtained
from PLINK and I'd like to know If I'm interpreting wrongly what PLINK
is doing.
Thank you in advance.