You are on page 1of 2

> x = c(462, 579,726, 910, 1140, 1786, 2641, 306, 3665, 4336, 4737, 5175)

> y = c(560986, 549194, 610223, 726742, 651834, 568010, 592160, 637450, 696181, 727857,
760590, 581705)
> plot(x,y, pch=20, col="black", xlab="PRES ($/Kg)", ylab="CRES (ton/año)", main="Diagrama de
dispersión")
> #Regresión Exponencial#
> yp = log(y)
> reg1 = lm(yp~x)
> summary (reg1)

Call:
lm(formula = yp ~ x)

Residuals:
Min 1Q Median 3Q Max
-0.16361 -0.08563 0.02575 0.06164 0.16855

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.330e+01 5.041e-02 263.915 <2e-16 ***
x 2.569e-05 1.792e-05 1.433 0.182
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.1084 on 10 degrees of freedom


Multiple R-squared: 0.1704, Adjusted R-squared: 0.08739
F-statistic: 2.053 on 1 and 10 DF, p-value: 0.1824

> a1p = 1.330e+01


> b1 = 2.569e-05
> a1 = exp(a1p)
> curve (a1*exp(b1*x), add=T, col="green")
>
> #Regresión Potencial#
> xp = log(x)
> reg2 = lm(yp~xp)
> summary (reg2)

Call:
lm(formula = yp ~ xp)

Residuals:
Min 1Q Median 3Q Max
-0.14509 -0.09748 0.01611 0.07966 0.15786

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 13.02352 0.24389 53.400 1.28e-13 ***
xp 0.04622 0.03312 1.396 0.193
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.1089 on 10 degrees of freedom
Multiple R-squared: 0.163, Adjusted R-squared: 0.07931
F-statistic: 1.948 on 1 and 10 DF, p-value: 0.1931

> a2p = 13.02352


> b2 = 0.04622
> a2 = exp(a2p)
> curve (a2*(x^b2), add=T, col="blue")
>
> #Regresión cuadrática#
> reg3 = lm(y~x+I(x^2))
> summary (reg3)

Call:
lm(formula = y ~ x + I(x^2))

Residuals:
Min 1Q Median 3Q Max
-97354 -59923 12042 41537 109415

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.894e+05 5.425e+04 10.864 1.79e-06 ***
x 3.351e+01 6.065e+01 0.553 0.594
I(x^2) -3.129e-03 1.124e-02 -0.278 0.787
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 73310 on 9 degrees of freedom


Multiple R-squared: 0.1844, Adjusted R-squared: 0.003112
F-statistic: 1.017 on 2 and 9 DF, p-value: 0.3997

> a3 = 5.894e+05
> b3 = 3.351e+01
> c3 = -3.129e-03
> curve (a3+(b3*x)+(c3*(x^2)), add=T, col="red")
>

You might also like