Está en la página 1de 5

Ejercicios de Regresion

Jonathan Jami
23 de julio de 2017

1. Ejercicio 1 cap 11 literal 10


Un articulo en wear (Vol.152, 1992, pp 171-181) presenta datos sobre el desgaste por el acero suave y la
viscosidad del aceite. Siguen datos representativos, con X la viscosidad del aceite y el volumen del desgaste Y.

Viscosidad Desgaste
X Y
1.6 240
9.4 181
15.5 193
20 155
22 172
35.5 110
43 113
40.5 75
33 94

1.1. Diagrama de dispersion


> setwd("C:/Users/USER/Desktop/4. Cuarto semestre/Estadistica_Aplicada/Prueba_Estadistica")
> datos<-read.csv(file ="Base_1.csv",header = T,sep = ";",dec = "." )
> View(datos)
> head(datos)

Viscosidad Desgaste
1 1.6 240
2 9.4 181
3 15.5 193
4 20.0 155
5 22.0 172
6 35.5 140

> attach(datos)
> plot(datos,col=4,pch=20)

1
200
Desgaste

150
100

0 10 20 30 40

Viscosidad

1.2. Regresion Lineal


> x<-Viscosidad
> y<-Desgaste
> reg.lineal<-lm(y~x)
> summary(reg.lineal)

Call:
lm(formula = y ~ x)

Residuals:
Min 1Q Median 3Q Max
-29.32 -20.41 11.78 12.79 24.95

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 232.5083 15.5161 14.98 1.41e-06 ***
x -3.3087 0.5542 -5.97 0.000559 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 22.52 on 7 degrees of freedom


Multiple R-squared: 0.8358, Adjusted R-squared: 0.8124
F-statistic: 35.64 on 1 and 7 DF, p-value: 0.0005588

> plot(datos,col=4,pch=20)
> abline(reg.lineal,col=4)

2
200
Desgaste

150
100

0 10 20 30 40

Viscosidad

2. Ejercicio 2 cap 11 literal 10


Un articulo en wear (Vol.152, 1992, pp 171-181) presenta datos sobre el desgaste por el acero suave y la
viscosidad del aceite. Siguen datos representativos, con X la viscosidad del aceite y el volumen del desgaste Y.

Viscosidad Desgaste
X Y
1.6 240
9.4 181
15.5 193
20 155
22 172
35.5 110
43 113
40.5 75
33 94

2.1. Diagrama de dispersion


> setwd("C:/Users/USER/Desktop/4. Cuarto semestre/Estadistica_Aplicada/Prueba_Estadistica")
> datos<-read.csv(file ="Base_1.csv",header = T,sep = ";",dec = "." )
> View(datos)
> head(datos)

Viscosidad Desgaste
1 1.6 240
2 9.4 181

3
3 15.5 193
4 20.0 155
5 22.0 172
6 35.5 140

> attach(datos)
> plot(datos,col=4,pch=20)
200
Desgaste

150
100

0 10 20 30 40

Viscosidad

2.2. Regresion Lineal


> x<-Viscosidad
> y<-Desgaste
> reg.lineal<-lm(y~x)
> summary(reg.lineal)

Call:
lm(formula = y ~ x)

Residuals:
Min 1Q Median 3Q Max
-29.32 -20.41 11.78 12.79 24.95

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 232.5083 15.5161 14.98 1.41e-06 ***
x -3.3087 0.5542 -5.97 0.000559 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

4
Residual standard error: 22.52 on 7 degrees of freedom
Multiple R-squared: 0.8358, Adjusted R-squared: 0.8124
F-statistic: 35.64 on 1 and 7 DF, p-value: 0.0005588

> plot(datos,col=4,pch=20)
> abline(reg.lineal,col=4)
200
Desgaste

150
100

0 10 20 30 40

Viscosidad

También podría gustarte