Notes on Partitioning Variance

Lilly Bock-Brownstein

Feb. 15, 2013

I find looking at the distribution of wage. So,

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

Modelling wage by sex and Variance of the fitted model

mod = mm(wage ~ sex, data = cps)
var(fitted(mod))
## [1] 1.114

Variance of the residuals

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

Variance of the response variable

var(wage ~ sex, data = cps)
##     F     M 
## 22.28 27.94

If the variance of the fitted model and the variance of the variance of the residuals from the model are afdded together, then we obtain the variance of the response variables. In this case 26.41032=1.11391+25.29641

However, this does not work for standard devation.
Standard deviation of wage modeled by sex:

sd(wage, data = cps)
## [1] 5.139

Standard deviation of the fitted model:

mod = mm(wage ~ sex, data = cps)
sd(fitted(mod))
## [1] 1.055

Standard deviation of the residual

sd(resid(mod))
## [1] 5.03

5.139097 does not equal 1.055419+ 5.029553