fit.lm = lm(mtcars$mpg ~ mtcars$cyl)
decomp = decomposition(mtcars$mpg, coefficients(fit.lm), fit.lm$model,
mtcars$hp, wt = rep(1, nrow(mtcars)), correction = FALSE)
summary(decomp)
Run the code above in your browser using DataLab