Smoking habits of UK residents. 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.1
library(openintro)
## Please visit openintro.org for free statistics materials
##
## Attaching package: 'openintro'
## The following object is masked from 'package:datasets':
##
## cars
data(smoking)
What does each row of the data matrix represent?
library(knitr)
df <- smoking
kable(head(df, 7))
| gender | age | maritalStatus | highestQualification | nationality | ethnicity | grossIncome | region | smoke | amtWeekends | amtWeekdays | type |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Male | 38 | Divorced | No Qualification | British | White | 2,600 to 5,200 | The North | No | NA | NA | |
| Female | 42 | Single | No Qualification | British | White | Under 2,600 | The North | Yes | 12 | 12 | Packets |
| Male | 40 | Married | Degree | English | White | 28,600 to 36,400 | The North | No | NA | NA | |
| Female | 40 | Married | Degree | English | White | 10,400 to 15,600 | The North | No | NA | NA | |
| Female | 39 | Married | GCSE/O Level | British | White | 2,600 to 5,200 | The North | No | NA | NA | |
| Female | 37 | Married | GCSE/O Level | British | White | 15,600 to 20,800 | The North | No | NA | NA | |
| Male | 53 | Married | Degree | British | White | Above 36,400 | The North | Yes | 6 | 6 | Packets |
| From the | above | columns we can s | ee that each row repres | ents an indivi | dual. |
How many participants were included in the survey?
There are 1691 participants in the survey.
names(smoking)
## [1] "gender" "age" "maritalStatus"
## [4] "highestQualification" "nationality" "ethnicity"
## [7] "grossIncome" "region" "smoke"
## [10] "amtWeekends" "amtWeekdays" "type"
Indicate whether each variable in the study is numerical or categorical. If numerical, identify as continuous or discrete. If categorical, indicate if the variable is ordinal.
str(smoking)
## 'data.frame': 1691 obs. of 12 variables:
## $ gender : Factor w/ 2 levels "Female","Male": 2 1 2 1 1 1 2 2 2 1 ...
## $ age : int 38 42 40 40 39 37 53 44 40 41 ...
## $ maritalStatus : Factor w/ 5 levels "Divorced","Married",..: 1 4 2 2 2 2 2 4 4 2 ...
## $ highestQualification: Factor w/ 8 levels "A Levels","Degree",..: 6 6 2 2 4 4 2 2 3 6 ...
## $ nationality : Factor w/ 8 levels "British","English",..: 1 1 2 2 1 1 1 2 2 2 ...
## $ ethnicity : Factor w/ 7 levels "Asian","Black",..: 7 7 7 7 7 7 7 7 7 7 ...
## $ grossIncome : Factor w/ 10 levels "10,400 to 15,600",..: 3 9 5 1 3 2 7 1 3 6 ...
## $ region : Factor w/ 7 levels "London","Midlands & East Anglia",..: 6 6 6 6 6 6 6 6 6 6 ...
## $ smoke : Factor w/ 2 levels "No","Yes": 1 2 1 1 1 1 2 1 2 2 ...
## $ 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 : Factor w/ 5 levels "","Both/Mainly Hand-Rolled",..: 1 5 1 1 1 1 5 1 4 5 ...
As we can see from the above command, the only features that are not categorical are: * Age * amtWeekends * amtWeekdays Amoung those, all are discrete. Having said that, the argument could be made for age being continuious.
Cheaters, scope of inference. 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. Diferences were observed in the cheating rates in the instruction and no instruction groups, as well as some difrences across children’s characteristics within each group. ### 1.10 a) Identify the population of interest and the sample in this study.
The sample of interest is children age 5-15. The sample is 160 of those children.
Comment on whether or not the results of the study can be generalized to the population, and if the findings of the study can be used to establish causal relationships?
From the short paragraph I believe that the study can be generalized. While it is doubtful that the children were selected at random– or without bias. The effects of the treatment as well as age and other charactersitics could be used to establish a causal relationship between similar children in the general population.
Below are excerpts from two articles published in the NY Times: ### 1.28 a) An article titled Risks: Smokers Found More Prone to Dementia states the following 2
“Researchers analyzed data from 23,123 health plan members who participated in a voluntary exam and health behavior survey from 1978 to 1985, when they were 50-60 years old. 23 years later, about 25% of the group had dementia, including 1,136 with Alzheimer’s disease and 416 with vascular dementia. After adjusting for other factors, the researchers concluded that pack-aday smokers were 37% more likely than nonsmokers to develop dementia, and the risks went up with increased smoking; 44% for one to two packs a day; and twice the risk for more than two packs.”
Based on this study, can we conclude that smoking causes dementia later in life? Explain your reasoning.
Without seeing the controls SD or Var I do not feel qualified to make an answer. If we could see the controls for the study, we might be able to assume that factors like initial intelegence/diet/socioeconomic status etc. were controlled for. Or, if the sample was drawn from a homogenious group we could also possibly make a conclusion although this is unlikely for something as unrandom as smoking.
Another article titled The School Bully Is Sleepy states the following: > The University of Michigan study, collected survey data from parents on each child’s sleep habits and asked both parents and teachers to assess behavioral concerns. About a third of the students studied were identified by parents or teachers as having problems with disruptive behavior or bullying. The researchers found that children who had behavioral issues and those who were identified as bullies were twice as likely to have shown symptoms of sleep disorders.
A friend of yours who read the article says, “The study shows that sleep disorders lead to bullying in school children.” Is this statement justified? If not, how best can you describe the conclusion that can be drawn from this study?
No, The statement is not justified. While it is possible that there exists a relationship, we can not rule out that children who bully sleep less and not the otherway around, i.e. correlation does not imply causation.
Exercise and mental health. A researcher is interested in the e↵ects 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.
What type of study is this?
This study is an experiment.
What are the treatment and control groups in this study?
The treatment groups excercised twice a week, the controll group did not. (Really we should say that they were given the oppertunity to exercise in a lab environment because people can be lazy and put in minimal effort.)
Does this study make use of blocking? If so, what is the blocking variable?
Yes, age is the blocking variable.
Does this study make use of blinding?
No, because each group was specifically told to exercise or not.
Comment on whether or not the results of the study can be used to establish a causal relationship between exercise and mental health, and indicate whether or not the conclusions can be generalized to the population at large.
Yes, some generalization could be permitted. If we assumed that people were all equally likely to sign up for the study and that people complied with their treatment then we could draw some conclusions. (I would be worried that people who exercised regularily and were told to stop might be made depressed, thus skewing the results, it may have been better to tell the control group to do what they want, like a honey badger.)
Suppose you are given the task of determining if this proposed study should get funding. Would you have any reservations about the study proposal?
Yes, I believe it is useful but the conclusions drawn (maybe by jurnalists, not scientists) could have been more restrained (e.g., people who changed their exercise paterns were likely to be happy if the started exercising vs stoped).
Below are the final exam scores of twenty introductory statistics students. 57, 66, 69, 71, 72, 73, 74, 77, 78, 78, 79, 79, 81, 81, 82, 83, 83, 88, 89, 94 Create a box plot of the distribution of these scores.
df <- c(57, 66, 69, 71, 72, 73, 74, 77, 78, 78, 79, 79, 81, 81, 82, 83, 83, 88, 89, 94)
boxplot(df)
QED.
Mix-and-match. Describe the distribution in the histograms below and match them to the box plots.
For each of the following, state whether you expect the distribution to be symmetric, right skewed, or left skewed. Also specify whether the mean or median would best represent a typical observation in the data, and whether the variability of observations would be best represented using the standard deviation or IQR. Explain your reasoning.
Housing prices in a country where 25% of the houses cost below $350,000, 50% of the houses cost below $450,000, 75% of the houses cost below $1,000,000 and there are a meaningful number of houses that cost more than $6,000,000.
This is probably right skewed since there is a long tail on the upper range. The median would be best to use because it will control for outliers. IQR should be used for the same reason.
Housing prices in a country where 25% of the houses cost below $300,000, 50% of the houses cost below $600,000, 75% of the houses cost below $900,000 and very few houses that cost more than $1,200,000.
This Data seems normally distrubuted. Mean, or for that matter median would work well. IQR and SD would both work but SD gives more information for advanced stats.
Number of alcoholic drinks consumed by college students in a given week. Assume that most of these students don’t drink since they are under 21 years old, and only a few drink excessively.
First assuming this means you are probably going to BYU. Secondly, data is right skewed and IQR and median should be used.
Annual salaries of the employees at a Fortune 500 company where only a few high level executives earn much higher salaries than all the other employees.
Same as above. Median and IQR should be used to omit the outlier effect.
The Stanford University Heart Transplant Study was conducted to determine whether an experimental heart transplant program increased lifespan. Each patient entering the program was designated an official heart transplant candidate, meaning that he was gravely ill and would most likely benefit from a new heart. Some patients got a transplant and some did not. The variable transplant indicates which group the patients were in; patients in the treatment group got a transplant and those in the control group did not. Another variable called survived was used to indicate whether or not the patient was alive at the end of the study. Of the 34 patients in the control group, 30 died. Of the 69 people in the treatment group, 45 died.
Based on the mosaic plot, is survival independent of whether or not the patient got a transplant? Explain your reasoning.
No, survivial does not seem to be independent. It looks like receiving treatment helped prolong life.
What do the box plots below suggest about the efficacy (effectiveness) of the heart transplant treatment.
There were some who it did not benefit but the mean is well above the 75% for the non treatment group so getting a treatment helped most people. Even at the 75% for the treatment group, only one person survived as long in the non treatment group. (The treatment is good, assumming that quality of life is constant.)
What proportion of patients in the treatment group and what proportion of patients in the control group died?
88.24% died in the controll group while 65.22% died in the treatment group.
One approach for investigating whether or not the treatment is effctive is to use a randomization technique.
Does the transplant help people live longer?
We write alive on____________ cards representing patients who were alive at the end of the study, and dead on_________ cards representing patientswho were not. Then, we shu✏e these cards and split them into two groups: one group of size representing treatment, and another group of size representing control. We calculate the di↵erence between the proportion of dead cards in the treatment and control groups (treatment -control) and record this value. We repeat this 100 times to build a distribution centered at . Lastly, we calculate the fraction of simulations where the simulated di↵erences in proportions are . If this fraction is low,we conclude that it is unlikely to have observed such an outcome by chance and that the null hypothesis should be rejected in favor of the alternative.
This question is weird and I don’t understand it. And I feel like I completley understand the study. Maybe the authours just tried to make it overly complicated?
It shows that the program is effective since most proprtions fall into a +- 25% range and the effectiviness was over 25%.