]> code.communitydata.science - stats_class_2020.git/blob - os_exercises/ch7b_exercises_solutions.rmd
initial commit
[stats_class_2020.git] / os_exercises / ch7b_exercises_solutions.rmd
1 ---
2 title: "Chapter 7 Textbook exercises (part b)"
3 subtitle: "Solutions to even-numbered questions  \nStatistics and statistical programming  \nNorthwestern University  \nMTS
4   525"
5 author: "Aaron Shaw"
6 date: "November 5, 2020"
7 output:
8   html_document:
9     toc: yes
10     toc_depth: 3
11     toc_float:
12       collapsed: false
13       smooth_scroll: true
14     theme: readable
15   pdf_document:
16     toc: no
17     toc_depth: '3'
18     latex_engine: xelatex
19 header-includes:
20   - \newcommand{\lt}{<}
21   - \newcommand{\gt}{>}
22   - \renewcommand{\leq}{≤}
23   - \usepackage{lmodern}
24 ---
25
26 ```{r setup, include=FALSE}
27 knitr::opts_chunk$set(echo = TRUE)
28
29 ```
30
31
32 All exercises taken from the *OpenIntro Statistics* textbook, $4^{th}$ edition, Chapter 7.
33
34 # 7.42 Work hours and education
35 (a) Hypotheses:
36
37 $H_0:$ The mean hours worked for the groups are all equal.
38
39 $$\mu_{\lt~hs} = \mu_{hs} = \mu_{jc} = \mu_{ba} = \mu_{grad} $$
40 $H_A:$ The mean hours worked vary by education level. In other words, the means are not equal. 
41
42 (b) Conditions and assumptions necessary for unbiased ANOVA estimates include:  
43
44 Independent observations, normal(ish) distributions, and constant(ish) variance. The problem doesn't say much about the sample to help evaluate the independence of the observations, but it's definitely less than 10% of the population and is likely a fairly good approximation of a random sample (thereby satisfying the rule of thumb). From the boxplots the distributions all look fairly normal. The standard deviations are also similar. We'll assume that the conditions are met for the purposes of the test.
45
46 (c) Working across the rows of the table, we can fill in the blanks:  
47
48 * The degrees of freedom for degree $= 5-1 = 4$  
49 * The Sum of Squares between degree levels $= 501.54 \times 4 = 2006.16$  
50 * The F value $= Sum~Sq~degree / Mean~Sq~residuals = 501.54 / 229.12 = 2.189$  
51 * The degrees of freedom for Residuals $= 1171-4 = 1167$  
52 * Mean Square Residuals (Error) $= 267382/1167 = 229.12$  
53 * Total degrees of freedom $=1172 - 1 = 1171$  
54 * Total Sum of squares $=2006.16+267382 = 269388.16$  
55
56 (d) According to the ANOVA results, we cannot reject the null hypothesis at a $p \leq 0.05$ level, suggesting that the mean number of hours worked per week may be equal across education levels.
57
58 # 7.44 Child care hours
59
60 (a) 
61 $H_0$: Average child care hours is the same for all attainment levels: $\mu_{College}~=~\mu_{TechOrVoc}~=~\mu_{UMS}~=~\mu_{LMS}~=~\mu_{PS}$
62 $H_A$: At least one pair of means are different.
63
64 (b) Since $p~\gt~0.05$, the results fail to reject $H_0$. The data do not provide convincing evidence of a difference between the average number of hours spent on child care across educational attainment levels.
65
66 # 7.46 True/False ANOVA questions
67
68 (a) False. The ANOVA procedure does not evaluate the pairwise comparisons, but the overall variation across groups.  
69 (b) True, otherwise the F-value will not be large enough to reject the null hypothesis.  
70 (c) False. It is possible that none of the pairwise comparisons will be significantly different even if the ANOVA rejects the null.  
71 (d) Assuming this question is about the Bonferroni correction, False. The correction does not divide $\alpha$ by the number of groups, but rather the number of pairwise tests. In this case, 4 groups yields ${4}\choose{2} = 6$ pairs, meaning that the corrected value for $\alpha = 0.05/6 = 0.0083$. Other corrections exist even though they were not discussed in the book (and the Reinhart reading) and they may choose other values for $\alpha$ or other procedures.

Community Data Science Collective || Want to submit a patch?