1.8 Smoking habits of UK residents.
# Each row represents an individuals response to the survey questions or a case.
# 1691 participants in the survey
# sex: categorical, nominal
# age: numerical, discrete
# marital: categorical, nominal
# grossIncome: categorical, ordinal
# smoke: categorical, nominal
# amtWeekends: numerical, discrete
# amtWeekdays: numerical, dicrete
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.
# The population of interest are all children between the ages of 5 and 15 who can have siblings or be an only child. The sample in the study only has 160 children students between the ages of 5 and 15 and has them report their age, gender, and whether or not they have any siblings.
# The results cannot be generalized because the sampling was not random. The sample was selected for out of a group of students and had to fall within the age range the researchers were interested in. However, the sample was randomly assigned into the different groups, one being reminded explicitly not to cheat while the other group was not reminded to be honest, allowing the study to establish causal relationships for the sample.
1.28 Reading the paper. Below are excerpts from two articles published in the NY Times:
# No, the researchers cannot conclude smoking causes dementia later in life because the experiment was an observational study that selected participants from a group that had a health plan and volunteered for an exam and health and behavior survey. However, they can conclude that there is a correlation for the sample.
# I don't believe my friends statement is justified. It was an observational study that had the parents and teachers assign the students into groups, therefore, we can only conclude that there is a positive correlation between sleep disorder symptoms and disruptive behabior/bullying.
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 rep- resentative 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. (a) What type of study is this?
# This is an ideal experimental study with random sampling and assignment
# Treatment groups are half of the subjects from each age group that are assigned to exercise twice a week during the study. Teh control groups were instructed not to exercise.
# Yes, the blocking variable is age.
# No, the experiement does not make use of blinding.
# The results can be used to establish a causal relationship that can be generalized to the public because it used a random sample with random assignment.
# The experiment did not control for what the particpants did for their workout routines and the fact that there is no blinding could lead to a bias between groups.
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 Create a box plot of the distribution of these scores. The five number summary provided below may be useful. Min Q1 Q2 (Median) Q3 Max 57 72.5 78.5 82.5 94
scores <- c(57, 66, 69, 71, 72, 73, 74, 77, 78, 78, 79, 79, 81, 81, 82, 83, 83, 88, 89, 94)
boxplot(scores)
1.50 Mix-and-match. Describe the distribution in the histograms below and match them to the box plots.
# (a) The histogram shows a normal distrubution, a bell like curve, and matches boxplot (2)
# (b) The histogram shows a plateau distribution, with many peaks close togethet, and matches boxplot (3)
# (c) the histogram shoes a right skewed distribution, asymmetrical with the tail on the right, and matches boxplot (1)
1.56 Distributions and appropriate statistics, Part II . 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. (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.
# I would expect a right skewed distribution that the median and IQR would best represent and not be skewed by the outliers near 6 million.
# I would expect a normal distribution that the mean and SD would represent very well. With few outliers, SD and mean are great descriptors of normal distributions.
# I would expect a left skew and that median and IQR would best represent the data because it would be more robust and not be affected by outlier weekly drink counts.
# I would expect a left skew and that median and IQR would best represent the data because they would not be skewed by outlier salaries.
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 offcial 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.
library(openintro)
## Please visit openintro.org for free statistics materials
##
## Attaching package: 'openintro'
## The following objects are masked from 'package:datasets':
##
## cars, trees
data("heartTr")
# The mosaic plot makes it apparent that the patients that recieved treatment, a heart transplant, were more likely to survive than the patients that did not receive treatment in the control group and survival is therefore dependent on treatment.
# The box plots suggest that the transplants were extremely effective, extending the survival time of the treated patients.
# From the mosaic plot it appears about 85% of the control group died and about 65% of the treatment group died
# The claims being tested are that trasplants increase survival rates and survival time.
# 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 [equal to or greater than approx. -25%]. 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.
sum(heartTr$survived=='alive')
## [1] 28
sum(heartTr$survived=='dead')
## [1] 75
sum(heartTr$transplant == 'treatment')
## [1] 69
sum(heartTr$transplant == 'control')
## [1] 34