# 13 More Linear Models

## Overview

Here we’ll extend what we learned in the last two chapters to regression models with multiple predictors and to ANCOVA (Analsysis of Covariance). We’ll also briefly touch on more complex designs and on using contrast to test specific between-group hypotheses.

Objectives

Upon completion of this lesson, you should be able to:

- Fit and interpret regression models with multiple predictors
- Fit and interpret ANCOVA models
- Test specific contrasts from
`lm()`

objects

## Data and R Code Files

The R code file and data files for this lesson can be found on the Essential R - Notes on learning R page.

## 13.1 Multiple Regression I

In this video we’ll extend the use of the formula interface in `lm()`

to specify multiple continuous predictor variables.

## 13.2 Multiple Regression II

Here we’ll continue our discussion of multiple regression.

## 13.3 ANCOVA I

By now we’ve fit models with one or more continuous predictors and one or more categorical predictors. In ANCOVA we combine continuous and categorical predictors. Once again `lm()`

is the tool of choice. Here we’ll focus on interpreting the coefficients in the ouput from `summary()`

.

## 13.4 ANCOVA II

In this second video on ANCOVA we’ll conclude with interpretation of the results and we’ll compare the output to graphical representation of the model.

## 13.5 A Note About Sums of Square in R

Functions like `anova()`

and `aov()`

in R return Type I sums of squares, while some other statistical programs return type Type III sums of squares. He’re we’ll give an overview of what tham means and how it affects interpretation.

## 13.6 Resistant Regression

Since all linear models are subject to the same regression assumptions, there are occasions where a resistant regression method might be appropriate. Here we’ll look at a resistant regression method in R.

## 13.7 Specifying Contrasts

We previously learned about using `TukeyHSD()`

for making all pairwise comparisons between groups in a model. In some cases we only want to make specific comparisons, and don’t want to lose statistical power by correcting for the larger number of comparisons. Here we show how to specify contrasts from a linear model.

## 13.8 More Complex Designs

There are many possible experimental designs, and the details of the design can have important implications for how the data is analyzed. Here we’ll look at the example of a split-plot design, and consider how to analyze such an experiment in R.