lm icon indicating copy to clipboard operation
lm copied to clipboard

Swiss examples are missing 1s column

Open pglezen opened this issue 8 years ago • 0 comments

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.

pglezen avatar Jan 11 '17 06:01 pglezen