Professional Documents
Culture Documents
RRRRRRRRRRRRRRR VVVVVV
RRRRRRRRRRRRRRR VVVVVV
> y<-c(2,3,5,4,6)
>x
[1] 1 2 3 4 5
> cov(x,y)
[1] 2.25
> sd(x)
[1] 1.581139
> sd(y)
[1] 1.581139
> cor(x,y)
[1] 0.9
> lm(y~x)
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
1.3 0.9
> plot(x,y)
> plot(x,y,lwd=10,col="blue")
> abline(lm(y~x))
> points(3,4)
> points(3,4,lwd=5;col="red")
> points(3,4,lwd=5,col="red")
> crid(col="green")
Error in crid(col = "green") : no se pudo encontrar la función "crid"
> grid(col="green")
> predict(lm(y~x))
1 2 3 4 5
> residuals(lm(y~x))
1 2 3 4 5
> summary(lm(y~x))
Call:
lm(formula = y ~ x)
Residuals:
1 2 3 4 5
Coefficients:
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1