I want to know the correct way to do permutation test when there are covariates (e.g. age, principle components) in addition to SNP in my model. I am considering a logistic regression model. Without covariates, what I do is permute case/control statuses for many times and get a null distribution of test statistic. But now, should I permute phenotypes together with the covariates to make them matched for each individual? In other words, what is permuted is the phenotype after corrected for covariates.