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)
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
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)Number of participants is 1691If 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)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.
- Population of interest is children between the ages of 5 and 15
- Sample size for the study is 160 (children)(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.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.”
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.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.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.
Random experimenttreatment 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 experimentYes, age is the blocking variableYes as the researcher is not aware of which section of population that eercised and whoch did notDeriving 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.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.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
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")(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 2Now 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
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.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)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).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.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.
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.The survival time is significantly higher with treatment transplant compared to control transplanttable(heartTr$survived, heartTr$transplant)[2,1]/nrow(heartTr)## [1] 0.2912621
table(heartTr$survived, heartTr$transplant)[2,2]/nrow(heartTr)## [1] 0.4368932
The claims being tested is that treatment transplant is much better than control transplantWe 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.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.