Forum rules
Please remember not to post any sensitive data on this public forum.The first few posts of newly registered users will be moderated in order to filter out any spammers.

When get a solution to the problem you posted, please change the topic name (e.g. from "how to ..." to "[SOLVED] how to ..."). This will make it easier for the community to follow the posts yet to be attended.

We are analyzing some binary traits where we need to adjust for relatedness, but each trait also needs to be adjusted for some relevant covariates. When using a quantitative trait, one runs polygenic to generate the required inverse of the variance/covariance matrix and then uses palinear to analyze the residuals, but with a binary trait, I found this advice on the forum regarding the usage of palogist:

in fact you should not use the residuals but the phenofile shoud contain the original phenotype and the covariates also.

However, it is still not clear if the invmat correlation matrix should be generated from a run of polygenic_hglm where the covariates were included or when they were excluded.

So is this the proper approach?:

1) Use polygenic_hgm with trait.type = "binomial" to compute the required correlation matrix, while adjusting for the covariates: