Linear Models with R, Question 1.1
data(teengamb, package="faraway")
head(teengamb)
## sex status income verbal gamble
## 1 1 51 2.00 8 0.0
## 2 1 28 2.50 8 0.0
## 3 1 37 2.00 6 0.0
## 4 1 28 7.00 4 7.3
## 5 1 65 2.00 8 19.6
## 6 1 61 3.47 6 0.1
summary(teengamb)
## sex status income verbal
## Min. :0.0000 Min. :18.00 Min. : 0.600 Min. : 1.00
## 1st Qu.:0.0000 1st Qu.:28.00 1st Qu.: 2.000 1st Qu.: 6.00
## Median :0.0000 Median :43.00 Median : 3.250 Median : 7.00
## Mean :0.4043 Mean :45.23 Mean : 4.642 Mean : 6.66
## 3rd Qu.:1.0000 3rd Qu.:61.50 3rd Qu.: 6.210 3rd Qu.: 8.00
## Max. :1.0000 Max. :75.00 Max. :15.000 Max. :10.00
## gamble
## Min. : 0.0
## 1st Qu.: 1.1
## Median : 6.0
## Mean : 19.3
## 3rd Qu.: 19.4
## Max. :156.0
Found this info online: sex 0=male, 1=female
status Socioeconomic status score based on parents' occupation
income in pounds per week
verbal verbal score in words out of 12 correctly defined
gamble expenditure on gambling in pounds per year
Source: https://rdrr.io/cran/faraway/man/teengamb.html
I am going to choose the field "gamble" to look at because I feel like one's socioeconomic status effects how much one would gamble because we need money to gamble, therefore a certain amount of wealth/status is required.
hist(teengamb$status,xlab="Status",main="")
The histogram above is not showing a binomial , Poisson, or exponential distribution.
plot(density(teengamb$status,na.rm=TRUE),main="")
plot(sort(teengamb$status),ylab="Sorted Status")
I feel like the next 2 graphs did not give me any insight.
plot(gamble~ status,teengamb)
plot(gamble ~ sex, teengamb)