# Interpretation of linear regression with covariates. Categorical variable has 3 levels

My independent variable is genotype, which has 3 levels (wild type, heterozygote and homozygote)

My dependent variable is calcium concentration, which is a continuous variable.

I first run a one-way anova to see whether there are significant differences in calcium concentration across genotypes.

Then, I want to adjust for the covariates, so I included the covariates in my model. The covariates are height and weight. I used the code lm(formula = calcium ~ genotype + height + weight)

I got some results but I don't know how to interpret them. Did my adjusted model hold weight and height constant so that only the effect of the independent variable was shown?

enter image description here

• This doesn't appear to be a specific programming question that's appropriate for Stack Overflow. If you have general questions about the interpretation of results from statistical methods, then you should ask such questions over at Cross Validated instead. You are more likely to get better answers there. – MrFlick Apr 8 at 20:30
• Also: please edit your question to include your coefficient table as cut-and-pasted text (possibly inside a code-formatting block), rather than as a screenshot. – Ben Bolker Apr 8 at 20:32

The referent level of a factor is chosen automatically if you don't specify (usually as it would appear in a sort()). With your output, it looks like you had 3 levels to genotype, and those would have been genotype.0, genotype.1, genotype.2.

Since the first one is not shown, it was used as the referent.

So your regression estimates for the first (non-intercept) line would be interpreted as genotype.1 compared to genotype.0 after adjusting for height and weight in the model.

If you were looking at 0,1,2 copies of an allele, then 1 copy of the allele is associated with a change of -.184505 unit of the outcome versus no copy of the allele.

That is the best I can do without a reproducible example.

To illustrate, let's use the iris() dataset that is built into R.

We can see the levels of the factor variable species by:

levels(iris\$Species)
[1] "setosa"     "versicolor" "virginica"


The first level is the referent.

If we call a regression to explain the variation in Sepal.Length with the variation in species, sepal.width, and petal.length, we will see the following output.

summary(lm(Sepal.Length ~ Species +  Sepal.Width + Petal.Length, data = iris))

Call:
lm(formula = Sepal.Length ~ Species + Sepal.Width + Petal.Length,
data = iris)

Residuals:
Min       1Q   Median       3Q      Max
-0.82156 -0.20530  0.00638  0.22645  0.74999

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)        2.39039    0.26227   9.114 5.94e-16 ***
Speciesversicolor -0.95581    0.21520  -4.442 1.76e-05 ***
Speciesvirginica  -1.39410    0.28566  -4.880 2.76e-06 ***
Sepal.Width        0.43222    0.08139   5.310 4.03e-07 ***
Petal.Length       0.77563    0.06425  12.073  < 2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3103 on 145 degrees of freedom
Multiple R-squared:  0.8633,    Adjusted R-squared:  0.8595
F-statistic: 228.9 on 4 and 145 DF,  p-value: < 2.2e-16


You can see that the versicolor and virginica levels were added to the species variable name. The missing level is the referent and is setosa.

So in this model, both versicolor and virginica are negatively associated with the variation in Sepal.Length after adjusted for the other covariates in the model.

• Thank you so much. I have some trouble understanding what "adjustment" means. Did my model hold my covariates constant so that the effects of the independent variable on the dependent variable could be discerned? Also, do you think I can call this model ANCOVA? – Zhenyu Li Apr 8 at 21:06
• The model I used as an example is NOT an ANCOVA. That is an analysis of covariance and is specified differently. Adjustment means you had other terms in the model that you wanted to account for prior to examining the term you were wanting to examine. In your case, you wanted to know the effects of genotype on your outcome, but after "adjusting" for height and weight. – akaDrHouse Apr 8 at 21:08