Multiple regression: Difference between revisions
Content added Content deleted
m (→{{header|R}}) |
m (→{{header|R}}) |
||
Line 2,153: | Line 2,153: | ||
R provides the '''lm''' function for linear regression. |
R provides the '''lm''' function for linear regression. |
||
<lang |
<lang rsplus>x <- c(1.47, 1.50, 1.52, 1.55, 1.57, 1.60, 1.63, 1.65, 1.68, 1.70, 1.73, 1.75, 1.78, 1.80, 1.83) |
||
y <- c(52.21, 53.12, 54.48, 55.84, 57.20, 58.57, 59.93, 61.29, 63.11, 64.47, 66.28, 68.10, 69.92, 72.19, 74.46) |
y <- c(52.21, 53.12, 54.48, 55.84, 57.20, 58.57, 59.93, 61.29, 63.11, 64.47, 66.28, 68.10, 69.92, 72.19, 74.46) |
||
Line 2,170: | Line 2,170: | ||
is useful to illustrate R's model description and linear algebra capabilities. |
is useful to illustrate R's model description and linear algebra capabilities. |
||
<lang |
<lang rsplus>simpleMultipleReg <- function(formula) { |
||
## parse and evaluate the model formula |
## parse and evaluate the model formula |