library(RCurl)
df <- read.csv("https://raw.githubusercontent.com/jbryer/DATA606Fall2020/master/course_data/os3_data/Ch%201%20Exercise%20Data/smoking.csv")
head(df)
## gender age maritalStatus highestQualification nationality ethnicity
## 1 Male 38 Divorced No Qualification British White
## 2 Female 42 Single No Qualification British White
## 3 Male 40 Married Degree English White
## 4 Female 40 Married Degree English White
## 5 Female 39 Married GCSE/O Level British White
## 6 Female 37 Married GCSE/O Level British White
## grossIncome region smoke amtWeekends amtWeekdays type
## 1 2,600 to 5,200 The North No NA NA
## 2 Under 2,600 The North Yes 12 12 Packets
## 3 28,600 to 36,400 The North No NA NA
## 4 10,400 to 15,600 The North No NA NA
## 5 2,600 to 5,200 The North No NA NA
## 6 15,600 to 20,800 The North No NA NA
1.10 (a) What does each row of the data matrix represent?’ Each row of the data matrix represents one responder’s answers to the survey. (b) How many participants were included in the survey? 1691
summary(df)
## gender age maritalStatus highestQualification
## Length:1691 Min. :16.00 Length:1691 Length:1691
## Class :character 1st Qu.:34.00 Class :character Class :character
## Mode :character Median :48.00 Mode :character Mode :character
## Mean :49.84
## 3rd Qu.:65.50
## Max. :97.00
##
## nationality ethnicity grossIncome region
## Length:1691 Length:1691 Length:1691 Length:1691
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## smoke amtWeekends amtWeekdays type
## Length:1691 Min. : 0.00 Min. : 0.00 Length:1691
## Class :character 1st Qu.:10.00 1st Qu.: 7.00 Class :character
## Mode :character Median :15.00 Median :12.00 Mode :character
## Mean :16.41 Mean :13.75
## 3rd Qu.:20.00 3rd Qu.:20.00
## Max. :60.00 Max. :55.00
## NA's :1270 NA's :1270
1.34
The study can be used to establish a causal relationshp between exercise and mental health. The conclusion can be generalized to the population at large because participants were picked randomnly.