Partitioning Variance

Thomas Eich

Feb. 18, 2012

My foot is in a boot so we are going to take a look at some childrens' feet:

foot = fetchData("kidsfeet.csv")
## Retrieving from http://www.mosaic-web.org/go/datasets/kidsfeet.csv

Modeling foot width by the sex of the child:

mod = mm(width ~ sex, data = foot)
var(fitted(mod))
## [1] 0.04222

Let's see what is is with our residuals:

var(resid(mod))
## [1] 0.2175

And the two together:

var(resid(mod)) + var(fitted(mod))
## [1] 0.2597

The variance of our response variable:

var(width, data = foot)
## [1] 0.2597

We can see that they match.

And with standard deviation?

sd(width, data = foot)
## [1] 0.5096

That gives us the total standard deviation.

sd(resid(mod)) + sd(fitted(mod))
## [1] 0.6718

We can see that the two do not match.