### Post by Jian Yang on Sept 21, 2015 11:31:30 GMT

For an analysis without a covariate, the GREML model can be written as

y = mu + g + e

where mu is the mean term (fixed effect), g is the genetic value (random effect) and e is the residual.

1. Categorical covariate (e.g. sex and cohort): --covar option

If the covariate is a categorical covariate, there will be t - 1 variables (where t is the number of categories, e.g. t = 2 for sex) because otherwise the

y = mu + x

where x is coded as 1 or 0 (representing the presence or absence of a category), b

2. Quantitative covariate (e.g. age): --qcovar option

The covariate is fitted as a continuous variable, then the model is

y = mu + x

where the interpretation of b

3. If we have a categorical covariate and two quantitative covariates, the model is

y = mu + x

Of course, we could also fit multiple quantitative covariates and multiple categorical covariates.

y = mu + g + e

where mu is the mean term (fixed effect), g is the genetic value (random effect) and e is the residual.

1. Categorical covariate (e.g. sex and cohort): --covar option

If the covariate is a categorical covariate, there will be t - 1 variables (where t is the number of categories, e.g. t = 2 for sex) because otherwise the

**X**^{T}**V**^{-1}**X**will not be invertible (**X**is design matrix for the fixed effects and**V**is the covariance-covariance matrix). Therefore, the model can be written asy = mu + x

_{c(2)}*b_{c(2)}+ x_{c(3)}*b_{c(3)}+ ... + x_{c(t)}*b_{c(t)}+ g + ewhere x is coded as 1 or 0 (representing the presence or absence of a category), b

_{c(i)}is interpreted as difference in mean phenotype in category i from the category 1. Note that the order of the categories are determined by their order of appearance in the covariate file.2. Quantitative covariate (e.g. age): --qcovar option

The covariate is fitted as a continuous variable, then the model is

y = mu + x

_{q(1)}*b_{q(1)}+ g + ewhere the interpretation of b

_{q(1)}is similar as that from a linear regression.3. If we have a categorical covariate and two quantitative covariates, the model is

y = mu + x

_{c(2)}*b_{c(2)}+ x_{c(3)}*b_{c(3)}+ ... + x_{c(t)}*b_{c(t)}+ x_{q(1)}*b_{q(1)}+ x_{q(2)}*b_{q(2)}+ g + eOf course, we could also fit multiple quantitative covariates and multiple categorical covariates.

**These fixed effects can be estimated using the --reml-est-fix option in a REML analysis. The estimates are shown in the log output following the order in the model above, i.e. the effect of each quantitative covariate followed by the effect each of category of the categorical covariates.**