R Basics
Just a demo, how R can be called from Sage to do something useful.
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.000 2.500 3.000 3.091 3.500 6.000
1
4
- 2
- 0
- -5
- 2
- -2
- 1
- 2
- 1
- -2
- 0
- 1
- -5
- 4
- 0
- -5
- 4
- 0
- -2
- -3
- 2
- 0
- -3
- 3
- -4
- 0
- 2
- -5
- 3
- 1
- 0
Min. 1st Qu. Median Mean 3rd Qu. Max.
-5.0000 -2.0000 0.0000 -0.2667 2.0000 4.0000
Linear Regression
Call:
lm(formula = Y ~ X)
Residuals:
Min 1Q Median 3Q Max
-10.8981 -2.7457 0.1564 2.8784 11.6248
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.6343 0.4371 -3.739 0.000311 ***
X 0.8292 0.1447 5.730 1.11e-07 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 4.355 on 98 degrees of freedom
Multiple R-squared: 0.2509, Adjusted R-squared: 0.2433
F-statistic: 32.83 on 1 and 98 DF, p-value: 1.11e-07