Dummy Variables and Analysis of Covariance
So far we have mostly seen quantitative variables in regression models, but many variables of interest are qualitative (sex, status, etc). To add such information to a model, we can set up a indicator/dummy variable.
For example, we could set up a variable Xi2 representing sex as 0 for type A and 1 for other for the ith individual. The resulting model would look something like:
Where Xi2 is 0 when the individual is type A. So for type A:
Models with Interaction
If we have a first-order regression model with an interaction we can represent it with an interaction term:
We can illustrate interaction as follows:
Beta2 indicates how much greater (smaller) the Y intercept for the class coded 1 than that of the class coded 0
Beta3 indicates how much greater (smaller) the slope for the class coded 1 then that of the class coded 0
Raw Mean
A raw mean is simply an average of the observations without considering other covariates. Least square means (sometimes called adjusted mean) are adjusted for other covariates, since it is estimated from a linear regression.
Qualitative Variable with 2+ Classes
If there are more than 2 classes to a qualitative variable, we require additional indicator variables in the regression model.
Resulting in a model like:
And the X matrix would look like:
No Comments