At first, we wanto to install some needed libraries:
library(car)
library(lmtest)
We got the data from …. the variables are…
adot <- read.csv2("holt-Laury-experiment.csv",sep=",",dec = ".")
adot
summary(adot)
choice bro_sis hardwork money gender
Min. : 3.000 Min. :0 Min. :1.0 Min. :3.000 Length:35
1st Qu.: 5.000 1st Qu.:0 1st Qu.:3.0 1st Qu.:3.500 Class :character
Median : 5.000 Median :1 Median :3.0 Median :4.000 Mode :character
Mean : 5.914 Mean :1 Mean :3.4 Mean :3.943
3rd Qu.: 7.000 3rd Qu.:1 3rd Qu.:4.0 3rd Qu.:4.000
Max. :10.000 Max. :3 Max. :5.0 Max. :5.000
some motivation for the choice of the variables, expected signs of the estimated coefficients…
attach(adot)
aaares <- lm(choice ~ +1 + bro_sis + hardwork + money + gender)
summary(aaares)
Call:
lm(formula = choice ~ +1 + bro_sis + hardwork + money + gender)
Residuals:
Min 1Q Median 3Q Max
-2.3271 -0.9588 -0.3783 0.6670 3.6217
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.7199 2.0722 0.347 0.731
bro_sis 0.2296 0.3509 0.654 0.518
hardwork 0.5571 0.3418 1.630 0.114
money 0.7413 0.4091 1.812 0.080 .
genderGirl 0.2355 0.5894 0.399 0.692
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.59 on 30 degrees of freedom
Multiple R-squared: 0.1826, Adjusted R-squared: 0.07366
F-statistic: 1.676 on 4 and 30 DF, p-value: 0.1816
plot(aaares)
We eliminate the gender variable, as it is not statistically signifficant.
attach(adot)
aaares <- lm(choice ~ +1 + bro_sis + hardwork + money )
summary(aaares)
Call:
lm(formula = choice ~ +1 + bro_sis + hardwork + money)
Residuals:
Min 1Q Median 3Q Max
-2.4995 -0.9252 -0.4581 0.7742 3.7022
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.6887 2.0425 0.337 0.738
bro_sis 0.2737 0.3286 0.833 0.411
hardwork 0.5661 0.3364 1.683 0.102
money 0.7678 0.3982 1.928 0.063 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.568 on 31 degrees of freedom
Multiple R-squared: 0.1783, Adjusted R-squared: 0.09877
F-statistic: 2.242 on 3 and 31 DF, p-value: 0.1031
plot(aaares)
Now, bro_sis variable is not statistically significant, we exlude it.
attach(adot)
The following objects are masked from adot (pos = 3):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 4):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 5):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 6):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 7):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 8):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 9):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 10):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 11):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 12):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 13):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 14):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 15):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 16):
bro_sis, choice, gender, hardwork, money
The following objects are masked from adot (pos = 17):
bro_sis, choice, gender, hardwork, money
aaares <- lm(choice ~ +1 + hardwork + money )
summary(aaares)
Call:
lm(formula = choice ~ +1 + hardwork + money)
Residuals:
Min 1Q Median 3Q Max
-2.4662 -0.8885 -0.4662 0.8520 3.7333
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.3169 1.8890 0.697 0.491
hardwork 0.5190 0.3300 1.573 0.126
money 0.7185 0.3918 1.834 0.076 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.56 on 32 degrees of freedom
Multiple R-squared: 0.1599, Adjusted R-squared: 0.1074
F-statistic: 3.045 on 2 and 32 DF, p-value: 0.06155
plot(aaares)
We see that the statistical signifficance of the harworking worsened and at the same time the picture of the residuals agains the fitted vlaue of the choice looses its smoothness, and the red line is as Zig-Zag saying the residuals jump up and down… That is, why we return the the previous model as the final one.
attach(adot)
aaares <- lm(choice ~ +1 + bro_sis + hardwork + money )
summary(aaares)
Call:
lm(formula = choice ~ +1 + bro_sis + hardwork + money)
Residuals:
Min 1Q Median 3Q Max
-2.4995 -0.9252 -0.4581 0.7742 3.7022
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.6887 2.0425 0.337 0.738
bro_sis 0.2737 0.3286 0.833 0.411
hardwork 0.5661 0.3364 1.683 0.102
money 0.7678 0.3982 1.928 0.063 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.568 on 31 degrees of freedom
Multiple R-squared: 0.1783, Adjusted R-squared: 0.09877
F-statistic: 2.242 on 3 and 31 DF, p-value: 0.1031
Based on the regression results, we see that the increasing hardworking will increase also the propensity to risk and, it raises aslo with the money-loving relation of the students. On the other side, we do not interpret the number of brothers/sisters, as this variable is not statistically signifficant and the corresponding regression coefficient can be considered zero.
In this research, we made ….