Regression Analysis Report

1/4
100%

y<-c(2.8, 3.4, 3.0, 3.5, 3.6, 3.0,2.7, 3.7)

> x<-c(21, 24, 26, 27, 29, 25, 25, 30)

> reg<-lm(y~x)

> reg

Call:

lm(formula = y ~ x)

Coefficients:

(Intercept) x

0.5681 0.1022

> # L'équation de la droite de régression GPA = 0.5681 + 0.1022 ACT

> # La relation entre GPA et ACT est >=0 car le coef directeur = 0.1022 >

> # Quel est le sens de la présence de la constante dans le modèle:0.5681 est la moyenne incompressible (ord à l'origine), la valeur de y = GPa lorsque x = 0.

> # la variation de y = 0.1022

> reg

Call:

lm(formula = y ~ x)

Coefficients:

(Intercept) x

0.5681 0.1022

> summary(reg)

Call:

lm(formula = y ~ x)

Residuals:

Min 1Q Median 3Q Max

-0.42308 -0.14863 0.06703 0.10742 0.37912

Coefficients:

Estimate Std. Error t value Pr(>|t|)

Publicité

(Intercept) 0.56813 0.92842 0.612 0.5630

x 0.10220 0.03569 2.863 0.0287 \*

---

Signif. codes: 0 ‘\\\’ 0.001 ‘\\’ 0.01 ‘\’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.2692 on 6 degrees of freedom

Multiple R-squared: 0.5774, Adjusted R-squared: 0.507

F-statistic: 8.199 on 1 and 6 DF, p-value: 0.02868

> reg$fitted.values

1 2 3 4 5 6 7

2.714286 3.020879 3.225275 3.327473 3.531868 3.123077 3.123077

8

3.634066

> # c'est le vecteur GPA = y ajustée ou bien fitted values c'est l'équation de la droite de régression en remplaçant à chaque fois x.

> reg$residuals

1 2 3 4 5

0.08571429 0.37912088 -0.22527473 0.17252747 0.06813187

6 7 8

-0.12307692 -0.42307692 0.06593407

> sum(reg$residuals)

[1] -2.775558e-17

> # e^ = y - y^ résidu, la somme des résidus est tjrs = 0.

> GPA\_predicted<-0.56813+0.1022\*20

> GPA\_predicted

[1] 2.61213

> #quel est le pourcentage d evariation expliqué par le modèle

> # ACT permet d'expliquer ? de variation de GPA

> # coed de détermination R^2 = 0.57.. = r^2 (coef de person ^2)

Publicité

> cor(y,x)

[1] 0.7598841

> cor(y,x)^2

[1] 0.5774238

> 176.4/19.6

[1] 9

> 176.4/1680.8

[1] 0.10495

> 1-0.10495

[1] 0.89505

> production=c(60, 120, 190, 250, 300,360, 380, 430, 440)

> travail=c(1100, 1200, 1430, 1500, 1520, 1620,1800,1820,1800)

> capital=c(300, 400, 420,400, 510,590, 600, 630,610)

> reg1=lm(production~travail)

> reg2(producton~capital)

Error in reg2(producton ~ capital) : could not find function "reg2"

> reg2<-(producton~capital)

> reg3<-lm(production~travail+capital)

> sumary(reg1)

Error in sumary(reg1) : could not find function "sumary"

> summary(reg1)

Call:

lm(formula = production ~ travail)

Residuals:

Min 1Q Median 3Q Max

-38.757 -14.608 1.501 21.744 33.933

Coefficients:

Publicité

Estimate Std. Error t value Pr(>|t|)

(Intercept) -503.63208 59.14765 -8.515 6.11e-05 \\\*

travail 0.51216 0.03812 13.437 2.97e-06 \\\*

---

Signif. codes: 0 ‘\\\’ 0.001 ‘\\’ 0.01 ‘\’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 28.08 on 7 degrees of freedom

Multiple R-squared: 0.9627, Adjusted R-squared: 0.9573

F-statistic: 180.5 on 1 and 7 DF, p-value: 2.967e-06

> summary(reg2)

Length Class Mode

3 formula call

> reg2

producton ~ capital

> reg2<-lm(producton~capital)

Error in eval(predvars, data, env) : object 'producton' not found

> reg2<-lm(production~capital)

> summary(reg2)

Call:

lm(formula = production ~ capital)

Residuals:

Min 1Q Median 3Q Max

-56.017 -15.982 -6.034 3.003 73.983

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) -263.913 58.965 -4.476 0.00288 \\

capital 1.100 0.116 9.477 3.04e-05 \\\*

---

Publicité

Signif. codes: 0 ‘\\\’ 0.001 ‘\\’ 0.01 ‘\’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 39.08 on 7 degrees of freedom

Multiple R-squared: 0.9277, Adjusted R-squared: 0.9174

F-statistic: 89.82 on 1 and 7 DF, p-value: 3.044e-05

> summary(reg3)

Call:

lm(formula = production ~ travail + capital)

Residuals:

Min 1Q Median 3Q Max

-34.050 -10.129 4.526 17.080 21.850

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) -437.71363 57.93097 -7.556 0.000279 \\\*

travail 0.33653 0.08966 3.753 0.009474 \\

capital 0.41002 0.19614 2.090 0.081555 .

---

Signif. codes: 0 ‘\\\’ 0.001 ‘\\’ 0.01 ‘\’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 23.07 on 6 degrees of freedom

Multiple R-squared: 0.9784, Adjusted R-squared: 0.9712

F-statistic: 135.9 on 2 and 6 DF, p-value: 1.007e-05

> # R^2 proche d e1 et l'hypothèse H0 refusée donc modèle globalement sifnificatif

> # tester la normalité des résidus; graphique du résidu en fonction de y^ ; graphique du résidu en fonction de x1 ensuite de x2.

> #Etudier la relation entre y et capital

> plot(capital,production)

> cor(production,capital)

[1] 0.9631731

Regression Analysis Report

Statistics, Data Analysis, Programming · lab

Voir tous les documents en mathématiques

y<-c(2.8, 3.4, 3.0, 3.5, 3.6, 3.0,2.7, 3.7)

> x<-c(21, 24, 26, 27, 29, 25, 25, 30)

> reg<-lm(y~x)

> reg

Call:

lm(formula = y ~ x)

Coefficients:

(Intercept) x

0.5681 0.1022

> # L'équation de la droite de régression GPA = 0.5681 + 0.1022 ACT

> # La relation entre GPA et ACT est >=0 car le coef directeur = 0.1022 >

> # Quel est le sens de la présence de la constante dans le modèle:0.5681 est la moyenne incompressible (ord à l'origine), la valeur de y = GPa lorsque x = 0.

> # la variation de y = 0.1022

> reg

Call:

lm(formula = y ~ x)

Coefficients:

(Intercept) x

0.5681 0.1022

> summary(reg)

Call:

lm(formula = y ~ x)

Residuals:

Min 1Q Median 3Q Max

-0.42308 -0.14863 0.06703 0.10742 0.37912

Coefficients:

Estimate Std. Error t value Pr(>|t|)

Publicité

(Intercept) 0.56813 0.92842 0.612 0.5630

x 0.10220 0.03569 2.863 0.0287 \*

---

Signif. codes: 0 ‘\\\’ 0.001 ‘\\’ 0.01 ‘\’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.2692 on 6 degrees of freedom

Multiple R-squared: 0.5774, Adjusted R-squared: 0.507

F-statistic: 8.199 on 1 and 6 DF, p-value: 0.02868

> reg$fitted.values

1 2 3 4 5 6 7

2.714286 3.020879 3.225275 3.327473 3.531868 3.123077 3.123077

8

3.634066

> # c'est le vecteur GPA = y ajustée ou bien fitted values c'est l'équation de la droite de régression en remplaçant à chaque fois x.

> reg$residuals

1 2 3 4 5

0.08571429 0.37912088 -0.22527473 0.17252747 0.06813187

6 7 8

-0.12307692 -0.42307692 0.06593407

> sum(reg$residuals)

[1] -2.775558e-17

> # e^ = y - y^ résidu, la somme des résidus est tjrs = 0.

> GPA\_predicted<-0.56813+0.1022\*20

> GPA\_predicted

[1] 2.61213

> #quel est le pourcentage d evariation expliqué par le modèle

> # ACT permet d'expliquer ? de variation de GPA

> # coed de détermination R^2 = 0.57.. = r^2 (coef de person ^2)

Publicité

> cor(y,x)

[1] 0.7598841

> cor(y,x)^2

[1] 0.5774238

> 176.4/19.6

[1] 9

> 176.4/1680.8

[1] 0.10495

> 1-0.10495

[1] 0.89505

> production=c(60, 120, 190, 250, 300,360, 380, 430, 440)

> travail=c(1100, 1200, 1430, 1500, 1520, 1620,1800,1820,1800)

> capital=c(300, 400, 420,400, 510,590, 600, 630,610)

> reg1=lm(production~travail)

> reg2(producton~capital)

Error in reg2(producton ~ capital) : could not find function "reg2"

> reg2<-(producton~capital)

> reg3<-lm(production~travail+capital)

> sumary(reg1)

Error in sumary(reg1) : could not find function "sumary"

> summary(reg1)

Call:

lm(formula = production ~ travail)

Residuals:

Min 1Q Median 3Q Max

-38.757 -14.608 1.501 21.744 33.933

Coefficients:

Publicité

Estimate Std. Error t value Pr(>|t|)

(Intercept) -503.63208 59.14765 -8.515 6.11e-05 \\\*

travail 0.51216 0.03812 13.437 2.97e-06 \\\*

---

Signif. codes: 0 ‘\\\’ 0.001 ‘\\’ 0.01 ‘\’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 28.08 on 7 degrees of freedom

Multiple R-squared: 0.9627, Adjusted R-squared: 0.9573

F-statistic: 180.5 on 1 and 7 DF, p-value: 2.967e-06

> summary(reg2)

Length Class Mode

3 formula call

> reg2

producton ~ capital

> reg2<-lm(producton~capital)

Error in eval(predvars, data, env) : object 'producton' not found

> reg2<-lm(production~capital)

> summary(reg2)

Call:

lm(formula = production ~ capital)

Residuals:

Min 1Q Median 3Q Max

-56.017 -15.982 -6.034 3.003 73.983

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) -263.913 58.965 -4.476 0.00288 \\

capital 1.100 0.116 9.477 3.04e-05 \\\*

---

Publicité

Signif. codes: 0 ‘\\\’ 0.001 ‘\\’ 0.01 ‘\’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 39.08 on 7 degrees of freedom

Multiple R-squared: 0.9277, Adjusted R-squared: 0.9174

F-statistic: 89.82 on 1 and 7 DF, p-value: 3.044e-05

> summary(reg3)

Call:

lm(formula = production ~ travail + capital)

Residuals:

Min 1Q Median 3Q Max

-34.050 -10.129 4.526 17.080 21.850

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) -437.71363 57.93097 -7.556 0.000279 \\\*

travail 0.33653 0.08966 3.753 0.009474 \\

capital 0.41002 0.19614 2.090 0.081555 .

---

Signif. codes: 0 ‘\\\’ 0.001 ‘\\’ 0.01 ‘\’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 23.07 on 6 degrees of freedom

Multiple R-squared: 0.9784, Adjusted R-squared: 0.9712

F-statistic: 135.9 on 2 and 6 DF, p-value: 1.007e-05

> # R^2 proche d e1 et l'hypothèse H0 refusée donc modèle globalement sifnificatif

> # tester la normalité des résidus; graphique du résidu en fonction de y^ ; graphique du résidu en fonction de x1 ensuite de x2.

> #Etudier la relation entre y et capital

> plot(capital,production)

> cor(production,capital)

[1] 0.9631731