1 Pre-Requistes : Setup R environment for DATA 606.

See https://data606.net/assignments/homework/ for more information. Chapter 1 - Introduction to Data Practice: 1.7 (available in R using the data(iris) command), 1.9, 1.23, 1.33, 1.55, 1.69 Graded: 1.8, 1.10, 1.28, 1.36, 1.48, 1.50, 1.56, 1.70 (use the library(openintro); data(heartTr) to load the data)


2 Exercises

2.1 Question 1.8 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. no sex age marital grossIncome smoke amtWeekends amtWeekdays 1 Female 42 Single Under£2,600 Yes 12 cig/day 12 cig/day 2 Male 44 Single £10,400 to £15,600 No N/A N/A 3 Male 53 Married Above£36,400 Yes 6 cig/day 6 cig/day … … 1691 Male 40 Single £2,600 to £5,200 Yes 8 cig/day 8 cig/day

2.1.1 (a) What does each row of the data matrix represent?

Each row of the data matrix represents the data provided in response to questions asked about the person''s sex age, marital, grossIncome, smoke, amtWeekends (number of cigarettes per day) and amtWeekdays (number of cigarettes per day)

2.1.2 (b) How many participants were included in the survey?

Number of participants is 1691

2.1.3 (c) 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.

sex: categorical (nominal)
age: numerical (discrete)
marital: categorical (nominal)
grossIncome: categorical (ordinal)
smoke: categorical (nominal)
amtWeekends: numerical (discrete)
amtWeekdays: numerical (discrete)

2.2 Question 1.10 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. 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.

2.2.1 (a) Identify the population of interest and the sample in this study.

- Population of interest is children between the ages of 5 and 15
- Sample size for the study is 160 (children)

2.2.2 (b) 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.

(1) Since the sample size is 160 that is very small for the study to be genealized to population of millions - this sample size may be good for population in 1000''s but not millions or 100''s of 1000''s. 
(2) Also this population of interest being only children between 5 and 15 this study results may not be extrapolated with other children over the age of 15
(3) Additionally, the sample size should include children from diverse socio-economic backgrounds since children from various financial backgrounds may be exposed to varying cheating habits from their environment and peers.

2.3 Question 1.28 Reading the paper.

Below are excerpts from two articles published in the NY Times: (a) An article titled Risks: Smokers Found More Prone to Dementia states the following: “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-a-day 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.”

2.3.1 Based on this study, can we conclude that smoking causes dementia later in life? Explain your reasoning.

No - although advent of dementia with smoking may be related but correlation may not always mean causation. Smoking might increase the likelihood of dementia but due to the low correlation smoking may not be considered as the cause of dementia.
  1. 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.”

2.3.2 Is this statement justified? If not, how best can you describe the conclusion that can be drawn from this study?

No - this is just a mere observation and another case of correlation and not causation. The study also does not state the sample size and how diverse the sample size is before jumping to conclusion.

2.4 Question 1.36 Exercise and mental health.

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.

2.4.1 (a) What type of study is this?

Random experiment

2.4.2 (b) What are the treatment and control groups in this study?

treatment group = The 18-30, 31-40 and 41-55 year olds who exercise twice a week during the experiment
control group = The 18-30, 31-40 and 41-55 year olds who did not exercise during the experiment

2.4.3 (c) Does this study make use of blocking? If so, what is the blocking variable?

Yes, age is the blocking variable

2.4.4 (d) Does this study make use of blinding?

Yes as the researcher is not aware of which section of population that eercised and whoch did not

2.4.5 (e) 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.

Deriving casual relationship based on the random experiment is allowed however the results may not be generalized to pouplation at large as other factors like sample size and diversity and population outside the experimentale age (<18 and >55) may be unfairly judged without conclusive evidence.

2.4.6 (f) Suppose you are given the task of determining if this proposed study should get funding. Would you have any reservations about the study proposal?

Random experiment of such proposal may not be as effective instead a detailed controlled experiment with a large and diverse sample size who are given similar diet during the period of study would lead to better general conclusion.

2.5 Question 1.48 Stats scores.

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 The five number summary provided below may be useful. Min Q1 Q2 (Median) Q3 Max 57 72.5 78.5 82.5 94

2.5.1 Create a box plot of the distribution of these scores.

examScores <- c(57, 66, 69, 71, 72, 73, 74, 77, 78, 78, 79, 79, 81, 81, 82, 83, 83, 88, 89, 94)
summary(examScores)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   57.00   72.75   78.50   77.70   82.25   94.00
boxplot(examScores, main="final exam scores of twenty introductory statistics students", horizontal=FALSE, col="Green")

2.6 Question 1.50 Mix-and-match.

2.6.1 Describe the distribution in the histograms below and match them to the box plots.

(a) Distribution in the histogram is Bell-Curve shaped - The matching box-plot is 2 where the values range between 50 and 70
(b) Distribution in the histogram is Uniformly/Evenly - Distributed - The matching box-plot is 3 where the values range between 0 and 100
(c) Distribution in the histogram is Right Skewed - The matching box-plot is 1 where values range between 0 and 6 and which is also skewed after 2

2.7 Question 1.56 Distributions and appropriate statistics, Part II .

Now it’s time to get creative. 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

2.7.1 (a) 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.

Distribution of housing prices are Right Skewed with increase in cost price range horizontally (x axis -> increase in cost price, y axis -> increase in number of houses) as the tail end will have lower number of houses due to high price compared to more number of houses in the lower price range.

2.7.2 (b) 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.

Distribution of housing prices are Uniformly/Evenly - Distributed as the data spread is symmetric with increase in cost price range horizontally (x axis -> increase in cost price, y axis -> increase in number of houses)

2.7.3 (c) 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.

Distribution of number of drinks in terms of increase in age horizontally (x axis -> increase in age, y axis -> increase in number of alocholic drinks) would be Left Skewed since the number of children drinking under age of 21 will be low and a spike in number of drinks after 21 years of age when they are the senior in the final year of college (assuming a 4 year undergraduate college).

2.7.4 (d) Annual salaries of the employees at a Fortune 500 company where only a few high level executives earn much higher salaries than the all other employees.

Distribution of annual salaries of the employees in terms of increase in salary horizontally (x axis -> increase in salary range, y axis -> increase in number of employees) would be Right Skewed as most employees would fall under the lower salary range as compared to higher salary range.

2.8 Question 1.70 Heart transplants.

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.

2.8.1 (a) Based on the mosaic plot, is survival independent of whether or not the patient got a transplant?

Explain your reasoning.

mosaicplot(heartTr$transplant~heartTr$survived, col="Light Blue", main="Heart Transplants")

DT::datatable(heartTr, options = list(pagelength=10))
table(heartTr$survived, heartTr$transplant)
##        
##         control treatment
##   alive       4        24
##   dead       30        45
table(heartTr$survived, heartTr$transplant)[1,1]/nrow(heartTr)*100
## [1] 3.883495
table(heartTr$survived, heartTr$transplant)[1,2]/nrow(heartTr)*100
## [1] 23.30097
Only 3% via no transplant (control) and 23% survival rate via transplant (treatment) is evident and hence there is some dependence on higher survival rate with transplant.

2.8.2 (b) What do the box plots below suggest about the efficacy (effectiveness) of the heart transplant treatment.

The survival time is significantly higher with treatment transplant compared to control transplant

2.8.3 (c) What proportion of patients in the treatment group and what proportion of patients in the control group died?

table(heartTr$survived, heartTr$transplant)[2,1]/nrow(heartTr)
## [1] 0.2912621
table(heartTr$survived, heartTr$transplant)[2,2]/nrow(heartTr)
## [1] 0.4368932

2.8.4 (d) One approach for investigating whether or not the treatment is effective is to use a randomization technique.

  1. What are the claims being tested?
The claims being tested is that treatment transplant is much better than control transplant
  1. The paragraph below describes the set up for such approach, if we were to do it without using statistical software. Fill in the blanks with a number or phrase, whichever is appropriate.
We write alive on (28) cards representing patients who were alive at the end of the study, and dead on (75) cards representing patients who were not. Then, we shuffle these cards and split them into two groups: one group of size (69) representing treatment, and another group of size (34) representing control. We calculate the difference 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 (0). Lastly, we calculate the fraction of simulations where the simulated differences in proportions are (0.23). 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.
  1. What do the simulation results shown below suggest about the effectiveness of the transplant program? simulated differences in proportions :
Since the simulated proprotions are pretty high (as high as 0.23), this means it less likely that the transplants successful results are due to chance. Hence, it proves that the transplant program was effective.