Regresión Lineal Simple
-
Upload
giselle-winters -
Category
Documents
-
view
34 -
download
0
description
Transcript of Regresión Lineal Simple
Regresión Lineal Simple
Planta Cap VolRosario 25 567.65Coyoacán 400 5676.48Acueducto de Guadalupe 87 1923.7San Juan de Aragón 500 4446.58Ciudad Deportiva 230 4099.68Iztacalco 13 315.36Cerro de la Estrella 4000 46957.1San Pedro Atocpan 60 1103.76San Juan Ixtayopan 15 252.29San Andrés Mixquic 30 946.08Abasolo 15 157.68Heroico Colegio Militar 30 630.72Parres 7 31.54PEMEX 26 315.36Xicalco 7 94.6Reclusorio Sur 30 378.43San Luis Tlaxialtemalco 150 1892.16Tlatelolco 22 378.43Bosque de las Lomas 55 473.04Campo Militar No. 1 30 378.43Chapultepec 160 2018.3
RS1. Plantas de Tratamiento de agua, DF , 1998
anova(modelo)Analysis of Variance TableResponse: Vol
Df Sum Sq Mean Sq F value Pr(>F) Cap 1 2029113094 2029113094 6676.1 < 2.2e-16 *** Residuals 19 5774809 303937Total 20 2034887903
--- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
summary(modelo)Call:lm(formula = Vol ~ Cap)
Residuals:Min 1Q Median 3Q Max -1593.94 -188.53 -60.96 78.99 1212.30
Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 201.3821 126.8122 1.5880.129 Cap 11.6783 0.1429 81.707 <2e-16 ***---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 551.3 on 19 degrees of freedomMultiple R-squared: 0.9972,Adjusted R-squared: 0.997 F-statistic: 6676 on 1 and 19 DF, p-value: < 2.2e-16
shapiro.test(modelo$residual) Shapiro-Wilk normality test data: modelo$residual W = 0.8475, p-value =0.003846
Transformación de variable
y<-sqrt(Vol)m2<-lm(y~Cap)
Analysis of Variance Table Response: y
Df Sum Sq Mean Sq F value Pr(>F) Cap 1 36673 36673 184.94 3.047e-11 *** Residuals 19 3768 198
--- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Shapiro-Wilk normality test data: m2$residuals W = 0.9196, p-value = 0.08506
RS2. Modelo de Pinzones
summary(m) Call: lm(formula = beak.length ~ mass, data = KenyaFinches) Residuals: Min 1Q Median 3Q Max -1.05373 -0.27044 -0.05373 0.33806 0.82956
Coefficients: Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.487159 0.112906 57.46 <2e-16 *** mass 0.110411 0.004608 23.96 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.4174 on 43 degrees of freedom Multiple R-squared: 0.9303, Adjusted R-squared: 0.9287 F-statistic: 574 on 1 and 43 DF, p-value: < 2.2e-16 >
Schluter, D. 1988. The evolution of finch communities on islands and continents: Kenya vs. Galapagos. Ecological Monographs 58: 229-249.
anova(m) Analysis of Variance Table Response: beak.length
Df Sum Sq Mean Sq F value Pr(>F) Mass 1 100.000 100.000 574.03 < 2.2e-16 *** Residuals 43 7.491 0.174 Total 44 107.491--- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
shapiro.test(m$residuals)Shapiro-Wilk normality test data: m$residuals W = 0.9784, p-value = 0.5572
RS3. Reforestación en el DF
m<-lm(Reforestacion~Superfice)summary(m) Call: lm(formula = Reforestacion ~ Superfice) Residuals: Min 1Q Median 3Q Max -148.43 -97.75 -10.08 92.44 180.59
Coefficients: Estimate Std. Error t value Pr(>|t|)
(Intercept) 186.3801 42.2576 4.4110.000593 *** Superfice -0.3078 0.3439 -0.895
0.385911
--- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 111.4 on 14 degrees of freedom Multiple R-squared: 0.05412, Adjusted R-squared: -0.01344 F-statistic: 0.801 on 1 and 14 DF, p-value: 0.3859
anova(m) Analysis of Variance Table Response: Reforestacion
Df Sum Sq Mean Sq F value Pr(>F) Superfice 1 9943 9943.1 0.801 0.3859 Residuals 14 173778 12412.7Total 15 183721
RS4. Dióxido de Carbono por uso vehicular
anio co2 uso1971 104.619 105.7421972 109.785 110.9951973 117.197 116.7421974 114.404 114.5921975 111.994 115.6051976 116.898 121.4671977 119.915 123.1231978 126.07 127.9531979 128.759 127.6481980 130.196 135.661981 126.409 138.1391982 103.136 141.9111983 134.212 143.7071984 140.721 151.2051985 143.462 154.4871986 153.074 162.2851987 159.999 174.8371988 170.312 187.4031989 177.51 202.9851990 182.686 204.9591991 181.348 205.3251992 183.757 205.5981993 185.869 205.6411994 186.872 210.8261995 185.1 214.9471996 192.249 220.7531997 194.667 225.7421998 193.438 229.027
Año base 1970=100
Redfern, A., Bunyan, M., and Lawrence, T. (eds) (2003). The Environment in Your Pocket, 7th edn. London: UK Department for Environment, Food and Rural Affairs.
Call: lm(formula = co2 ~ uso) Residuals: Min 1Q Median 3Q Max -29.5946 -0.7761 1.0901 2.4873 6.8163 Coefficients:
Estimate Std. Error t value Pr(>|t|) (Intercept) 25.39475 5.05584 5.023 3.16e-05 *** uso 0.75636 0.02999 25.223 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6.503 on 26 degrees of freedom Multiple R-squared: 0.9607, Adjusted R-squared: 0.9592 F-statistic: 636.2 on 1 and 26 DF, p-value: < 2.2e-16
Analysis of Variance Table Response: co2
Df Sum Sq Mean Sq F value Pr(>F) Uso 1 26904.1 26904.1 636.21 < 2.2e-16 *** Residuals 26 1099.5 42.3 Total 27 28003.6--- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1