Smoking habits of UK residents. (1.10, p. 20) A survey was conducted to study the smoking habits of UK residents. Below is a data matrix displaying a portion of the data collected in this survey. Note that “£” stands for British Pounds Sterling, “cig” stands for cigarettes, and “N/A” refers to a missing component of the data.
I have added the row data on new repository on Github via the link ‘https://raw.githubusercontent.com/akarimhammoud/606-Homework1/master/606%20-%20Homework1%20-%20smoking.csv’
url <- "https://raw.githubusercontent.com/akarimhammoud/606-Homework1/master/606%20-%20Homework1%20-%20smoking.csv"
smokingdata <- read.csv(file= url, header=TRUE, sep = ",")
summary(smokingdata)
## 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
head(smokingdata)
## 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
nrow(smokingdata)
## [1] 1691
str(smokingdata)
## 'data.frame': 1691 obs. of 12 variables:
## $ gender : chr "Male" "Female" "Male" "Female" ...
## $ age : int 38 42 40 40 39 37 53 44 40 41 ...
## $ maritalStatus : chr "Divorced" "Single" "Married" "Married" ...
## $ highestQualification: chr "No Qualification" "No Qualification" "Degree" "Degree" ...
## $ nationality : chr "British" "British" "English" "English" ...
## $ ethnicity : chr "White" "White" "White" "White" ...
## $ grossIncome : chr "2,600 to 5,200" "Under 2,600" "28,600 to 36,400" "10,400 to 15,600" ...
## $ region : chr "The North" "The North" "The North" "The North" ...
## $ smoke : chr "No" "Yes" "No" "No" ...
## $ amtWeekends : int NA 12 NA NA NA NA 6 NA 8 15 ...
## $ amtWeekdays : int NA 12 NA NA NA NA 6 NA 8 12 ...
## $ type : chr "" "Packets" "" "" ...
(1.14, p. 29) Exercise 1.5 introduces a study where researchers studying the relationship between honesty, age, and self-control conducted an experiment on 160 children between the ages of 5 and 15. . The researchers asked each child to toss a fair coin in private and to record the outcome (white or black) on a paper sheet, and said they would only reward children who report white. Half the students were explicitly told not to cheat and the others were not given any explicit instructions. Differences were observed in the cheating rates in the instruction and no instruction groups, as well as some differences across children’s characteristics within each group.
(1.28, p. 31) Below are excerpts from two articles published in the NY Times:
(1.34, p. 35) A researcher is interested in the effects of exercise on mental health and he proposes the following study: Use stratified random sampling to ensure representative proportions of 18-30, 31-40 and 41-55 year olds from the population. Next, randomly assign half the subjects from each age group to exercise twice a week, and instruct the rest not to exercise. Conduct a mental health exam at the beginning and at the end of the study, and compare the results.