Multiple regression: Difference between revisions
Content added Content deleted
(added Phix, moved PicoLisp) |
m (→{{header|R}}) |
||
Line 1,394: | Line 1,394: | ||
=={{header|R}}== |
=={{header|R}}== |
||
R provides the lm |
R provides the '''lm''' function for linear regression. |
||
⚫ | |||
<lang R>## Wikipedia Data |
|||
⚫ | |||
} |
|||
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) |
||
lm( y ~ x + I(x^2))</lang> |
lm( y ~ x + I(x^2))</lang> |
||
{{out}} |
{{out}} |
||
<pre> |
|||
Call: |
<pre>Call: |
||
lm(formula = y ~ x + I(x^2)) |
lm(formula = y ~ x + I(x^2)) |
||
Coefficients: |
Coefficients: |
||
(Intercept) x I(x^2) |
(Intercept) x I(x^2) |
||
128.81 -143.16 61.96 |
128.81 -143.16 61.96</pre> |
||
</pre> |
|||
A simple implementation of multiple regression in native R |
A simple implementation of multiple regression in native R |