-
Notifications
You must be signed in to change notification settings - Fork 7
/
Appendix.Rmd
280 lines (168 loc) · 7.92 KB
/
Appendix.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# (APPENDIX) Appendix {-}
# Rubric for inference {#appendix-rubric}
<!-- Please don't mess with the next few lines! -->
<style>h5{font-size:2em;color:#0000FF}h6{font-size:1.5em;color:#0000FF}div.answer{margin-left:5%;border:1px solid #0000FF;border-left-width:10px;padding:25px} div.summary{background-color:rgba(30,144,255,0.1);border:3px double #0000FF;padding:25px}</style>`r options(scipen=999)`<p style="color:#ffffff">`r intToUtf8(c(50,46,48))`</p>
<!-- Please don't mess with the previous few lines! -->
This is the R Markdown outline for running inference, both a hypothesis test and a confidence interval.
## Exploratory data analysis {-}
### Use data documentation (help files, code books, Google, etc.) to determine as much as possible about the data provenance and structure. {-}
::: {.answer}
Please write up your answer here
```{r}
# Add code here to print the data
```
```{r}
# Add code here to glimpse the variables
```
:::
### Prepare the data for analysis. [Not always necessary.] {-}
::: {.answer}
```{r}
# Add code here to prepare the data for analysis.
```
:::
### Make tables or plots to explore the data visually. {-}
::: {.answer}
```{r}
# Add code here to make tables or plots.
```
:::
## Hypotheses {-}
### Identify the sample (or samples) and a reasonable population (or populations) of interest. {-}
::: {.answer}
Please write up your answer here.
:::
### Express the null and alternative hypotheses as contextually meaningful full sentences. {-}
::: {.answer}
$H_{0}:$ Null hypothesis goes here.
$H_{A}:$ Alternative hypothesis goes here.
:::
### Express the null and alternative hypotheses in symbols (when possible). {-}
::: {.answer}
$H_{0}: math$
$H_{A}: math$
:::
## Model {-}
### Identify the sampling distribution model. {-}
::: {.answer}
Please write up your answer here.
:::
### Check the relevant conditions to ensure that model assumptions are met. {-}
::: {.answer}
Please write up your answer here. (Some conditions may require R code as well.)
:::
## Mechanics {-}
### Compute the test statistic. {-}
::: {.answer}
```{r}
# Add code here to compute the test statistic.
```
:::
### Report the test statistic in context (when possible). {-}
::: {.answer}
Please write up your answer here.
:::
### Plot the null distribution. {-}
::: {.answer}
```{r}
# IF CONDUCTING A SIMULATION...
set.seed(1)
# Add code here to simulate the null distribution.
```
```{r}
# Add code here to plot the null distribution.
```
:::
### Calculate the P-value. {-}
::: {.answer}
```{r}
# Add code here to calculate the P-value.
```
:::
### Interpret the P-value as a probability given the null. {-}
::: {.answer}
Please write up your answer here.
:::
## Conclusion {-}
### State the statistical conclusion. {-}
::: {.answer}
Please write up your answer here.
:::
### State (but do not overstate) a contextually meaningful conclusion. {-}
::: {.answer}
Please write up your answer here.
:::
### Express reservations or uncertainty about the generalizability of the conclusion. {-}
::: {.answer}
Please write up your answer here.
:::
### Identify the possibility of either a Type I or Type II error and state what making such an error means in the context of the hypotheses. {-}
::: {.answer}
Please write up your answer here.
:::
## Confidence interval {-}
### Check the relevant conditions to ensure that model assumptions are met. {-}
::: {.answer}
Please write up your answer here. (Some conditions may require R code as well.)
:::
### Calculate and graph the confidence interval. {-}
::: {.answer}
```{r}
# Add code here to calculate the confidence interval.
```
```{r}
# Add code here to graph the confidence interval.
```
:::
### State (but do not overstate) a contextually meaningful interpretation. {-}
::: {.answer}
Please write up your answer here.
:::
### If running a two-sided test, explain how the confidence interval reinforces the conclusion of the hypothesis test. [Not always applicable.] {-}
::: {.answer}
Please write up your answer here.
:::
### When comparing two groups, comment on the effect size and the practical significance of the result. [Not always applicable.] {-}
::: {.answer}
Please write up your answer here.
:::
# Concordance with *Introduction to Modern Statistics* (IMS) {#appendix-concordance}
This book is meant to be somewhat aligned pedagogically with part of the book [*Introduction to Modern Statistics* (IMS)](https://openintro-ims.netlify.app/) by Mine Çetinkaya-Rundel and Johanna Hardin. But it's not a perfect, one-to-one match. The table below shows the concordance between the two books with some notes that explain when one book does something different from the other.
| This book | IMS | Notes |
|-----------|-----------|-------------------------------------------------------|
| Ch. 1 | | This book contains a specific introduction to R and RStudio with some basic statistical vocabulary. |
| | Ch. 1 | IMS introduces a lot of vocabulary. This book introduces most of that same vocabulary, but across multiple chapters. |
| Ch. 2 | | This book contains a specific introduction to R Markdown. |
| | Ch. 2 | IMS discusses study design and sampling. Some of that information is scattered across multiple chapters of this book, but not all of it. (For example, this book doesn't get into stratified or cluster sampling.) |
| | Ch. 3 | IMS has "Applications" chapters at the end of each section. In this book, the applications are woven into each chapter. |
| Ch. 3 | Ch. 4 | Categorical data. |
| Ch. 4 | Ch. 5 | Numerical data. |
| Ch. 5 | | This book has a dedicated chapter on manipulating data using `dplyr`. |
| | Ch. 6 | Applications. |
| Ch. 6 | Ch. 7 | Correlation. |
| Ch. 7 | Ch. 7 | Simple linear regression. |
| | Ch. 8 | Multiple regression---not covered in this book. |
| | Ch. 9 | Logistic regression---not covered in this book. |
| | Ch. 10 | Applications. |
| Ch. 8 | Ch. 11 | Introduction to randomization, Part 1---This book takes four chapters to cover the material that IMS covers in one chapter. |
| Ch. 9 | Ch. 11 | Introduction to randomization, Part 2. |
| Ch. 10 | Ch. 11 | Hypothesis testing with randomization, Part 1. |
| Ch. 11 | Ch. 11 | Hypothesis testing with randomization, Part 2. |
| Ch. 12 | Ch. 12 | Confidence intervals. |
| Ch. 13 | Ch. 13 | Normal models---This book takes two chapters to cover the material that IMS covers in one chapter. |
| Ch. 14 | Ch. 13 | Sampling distribution models. |
| | Ch. 14 | IMS has a chapter on decision errors that was covered in this book back in Ch. 10. It also covers the concept of power, which is not covered in this book. |
| | Ch. 15 | Applications. |
| Ch. 15 | Ch. 16 | Inference for one proportion. |
| Ch. 16 | Ch. 17 | Inference for two proportions.|
| Ch. 17 | | Chi-square goodness-of-fit test. (This is only covered in IMS in a standalone R tutorial appearing in Ch. 23.) |
| Ch. 18 | Ch. 18 | Chi-square test for independence. |
| Ch. 19 | Ch. 19 | Inference for one mean. |
| Ch. 20 | Ch. 21 | Inference for paired data. |
| Ch. 21 | Ch. 20 | Inference for two independent means. |
| Ch. 22 | Ch. 22 | ANOVA. This is the last chapter of this book. |
| | Ch. 23 | Applications. |
| | Ch. 24 | Inference for linear regression with a single predictor. |
| | Ch. 25 | Inference for linear regression with multiple predictors.|
| | Ch. 26 | Inference for logistic regression. |
| | Ch. 27 | Applications. |