lm
lm copied to clipboard
Swiss examples are missing 1s column
In the Section 5.1.1 coding example (04_least_squares.tex
, line 54), the x
matrix is created without a column of ones. One way to correct this is to replace
x = as.matrix(swiss[,-1])
with the following two lines:
x = cbind(1, swiss[,-1])
x = as.matrix(x)
Then the rest of the results follow. The same should be corrected on line 335.