Biography |
|
xv | |
Preface |
|
xvii | |
Acknowledgments |
|
xix | |
|
Part I An introduction to statistics and R |
|
|
|
1 What is statistics and why is it important? |
|
|
|
|
3 | (1) |
|
1.2 So what is statistics? |
|
|
4 | (2) |
|
1.2.1 The process of statistics |
|
|
4 | (1) |
|
1.2.2 Hypothesis/questions |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (1) |
|
1.2.5 Statistical inference |
|
|
5 | (1) |
|
|
6 | (1) |
|
1.3 Computation and statistics |
|
|
6 | (1) |
|
|
|
|
7 | (1) |
|
|
7 | (1) |
|
2.3 Mathematical operations in R |
|
|
8 | (1) |
|
|
9 | (2) |
|
|
11 | (1) |
|
|
12 | (1) |
|
|
13 | (1) |
|
|
14 | (3) |
|
Part II Collecting data and loading it into R |
|
|
|
3 Data collection: methods and concerns |
|
|
|
|
17 | (1) |
|
3.2 Components of data collection |
|
|
17 | (1) |
|
3.3 Observational studies |
|
|
18 | (3) |
|
3.3.1 Biases in survey sampling |
|
|
19 | (2) |
|
|
21 | (1) |
|
|
21 | (2) |
|
|
23 | (1) |
|
3.5 Observational studies and experiments: which to use? |
|
|
23 | (2) |
|
|
24 | (1) |
|
|
25 | (2) |
|
4 R tutorial: subsetting data, random numbers, and selecting a random sample |
|
|
|
|
27 | (1) |
|
|
27 | (2) |
|
4.3 Subsetting data frames |
|
|
29 | (2) |
|
|
31 | (1) |
|
4.5 Select a random sample |
|
|
32 | (1) |
|
|
33 | (1) |
|
|
33 | (2) |
|
|
35 | (2) |
|
5 R tutorial: libraries and loading data into R |
|
|
|
|
37 | (1) |
|
|
37 | (5) |
|
5.3 Loading datasets stored in libraries |
|
|
42 | (1) |
|
5.4 Loading csv files into R |
|
|
42 | (1) |
|
|
43 | (1) |
|
|
43 | (4) |
|
Part III Exploring and describing data |
|
|
|
6 Exploratory data analyses: describing our data |
|
|
|
|
47 | (1) |
|
6.2 Parameters and statistics |
|
|
47 | (1) |
|
6.3 Parameters, statistics, and EDA for categorical variables |
|
|
48 | (3) |
|
|
50 | (1) |
|
6.4 Parameters, statistics, and EDA for a single quantitative variable |
|
|
51 | (6) |
|
6.4.1 Statistics for the center of a variable |
|
|
51 | (2) |
|
|
53 | (1) |
|
6.4.3 Statistics for the spread of a variable |
|
|
54 | (2) |
|
|
56 | (1) |
|
6.5 Visual summaries for a single quantitative variables |
|
|
57 | (2) |
|
|
59 | (2) |
|
|
61 | (1) |
|
6.7 Exploring relationships between variables |
|
|
61 | (1) |
|
6.8 Exploring association between categorical predictor and quantitative response |
|
|
62 | (3) |
|
|
65 | (1) |
|
6.9 Exploring association between two quantitative variables |
|
|
65 | (7) |
|
|
71 | (1) |
|
|
72 | (1) |
|
|
|
|
73 | (1) |
|
7.2 Frequency and contingency tables in R |
|
|
73 | (1) |
|
7.3 Numerical exploratory analyses in R |
|
|
74 | (3) |
|
7.3.1 Summaries for the center of a variable |
|
|
74 | (1) |
|
7.3.2 Summaries for the spread of a variable |
|
|
75 | (1) |
|
7.3.3 Summaries for the association between two quantitative variables |
|
|
76 | (1) |
|
|
77 | (1) |
|
|
78 | (1) |
|
7.6 Graphical exploratory analyses in R |
|
|
78 | (4) |
|
|
78 | (2) |
|
|
80 | (2) |
|
|
82 | (2) |
|
|
84 | (1) |
|
|
85 | (4) |
|
Part IV Mechanisms of inference |
|
|
|
8 An incredibly brief introduction to probability |
|
|
|
|
89 | (1) |
|
8.2 Random phenomena, probability, and the Law of Large Numbers |
|
|
90 | (1) |
|
8.3 What is the role of probability in inference? |
|
|
91 | (1) |
|
8.4 Calculating probability and the axioms of probability |
|
|
92 | (2) |
|
8.5 Random variables and probability distributions |
|
|
94 | (1) |
|
8.6 The binomial distribution |
|
|
95 | (1) |
|
8.7 The normal distribution |
|
|
96 | (2) |
|
|
98 | (1) |
|
|
99 | (2) |
|
9 Sampling distributions, or why exploratory analyses are not enough |
|
|
|
|
101 | (1) |
|
9.2 Sampling distributions |
|
|
101 | (4) |
|
9.3 Properties of sampling distributions and the central limit theorem |
|
|
105 | (2) |
|
|
107 | (1) |
|
|
107 | (2) |
|
10 The idea behind testing hypotheses |
|
|
|
|
109 | (1) |
|
|
109 | (1) |
|
|
110 | (5) |
|
10.3.1 What are we testing? |
|
|
110 | (2) |
|
10.3.2 How rare is our data? |
|
|
112 | (1) |
|
10.3.3 What is our level of doubt? |
|
|
113 | (2) |
|
|
115 | (1) |
|
|
115 | (2) |
|
11 Making hypothesis testing work with the central limit theorem |
|
|
|
|
117 | (1) |
|
11.2 Recap of the normal distribution |
|
|
117 | (1) |
|
11.3 Getting probabilities from the normal distributions |
|
|
118 | (1) |
|
|
119 | (1) |
|
11.4 Connecting data to p-values |
|
|
119 | (6) |
|
|
124 | (1) |
|
|
125 | (2) |
|
12 The idea of interval estimates |
|
|
|
|
127 | (1) |
|
12.2 Point and interval estimates |
|
|
127 | (1) |
|
12.3 When intervals are "right" |
|
|
128 | (1) |
|
12.4 Confidence intervals |
|
|
128 | (1) |
|
12.5 Creating confidence intervals |
|
|
129 | (3) |
|
12.6 Interpreting confidence intervals |
|
|
132 | (1) |
|
|
133 | (1) |
|
|
133 | (4) |
|
Part V Statistical inference |
|
|
|
13 Hypothesis tests for a single parameter |
|
|
|
|
137 | (1) |
|
13.2 One-sample test for proportions |
|
|
138 | (5) |
|
|
138 | (1) |
|
13.2.2 Set significance level |
|
|
138 | (1) |
|
13.2.3 Collect and summarize data |
|
|
139 | (1) |
|
13.2.4 Calculate test statistic |
|
|
139 | (1) |
|
13.2.5 Calculate p-values |
|
|
140 | (1) |
|
|
141 | (1) |
|
|
142 | (1) |
|
13.3 One-sample r-test for means |
|
|
143 | (7) |
|
|
143 | (1) |
|
13.3.2 Set significance level |
|
|
144 | (1) |
|
13.3.3 Collect and summarize data |
|
|
144 | (1) |
|
13.3.4 Calculate test statistic |
|
|
144 | (1) |
|
13.3.5 Calculate p-values |
|
|
145 | (1) |
|
13.3.6 A brief interlude: the t distribution |
|
|
146 | (2) |
|
|
148 | (2) |
|
|
150 | (1) |
|
|
150 | (1) |
|
14 Confidence intervals for a single parameter |
|
|
|
|
151 | (1) |
|
14.2 Confidence interval for p |
|
|
151 | (2) |
|
|
153 | (1) |
|
14.3 Confidence interval for jtt |
|
|
153 | (3) |
|
|
155 | (1) |
|
14.4 Other uses of confidence intervals |
|
|
156 | (6) |
|
14.4.1 Confidence intervals for p and sample size calculations |
|
|
156 | (3) |
|
|
159 | (1) |
|
14.4.3 Confidence intervals for \i and hypothesis testing |
|
|
159 | (2) |
|
|
161 | (1) |
|
|
162 | (1) |
|
15 Hypothesis tests for two parameters |
|
|
|
|
163 | (1) |
|
15.2 Two-sample test for proportions |
|
|
164 | (7) |
|
|
164 | (1) |
|
15.2.2 Set significance level |
|
|
165 | (1) |
|
15.2.3 Collect and summarize data |
|
|
165 | (1) |
|
15.2.4 Calculate the test statistic |
|
|
166 | (2) |
|
15.2.5 Calculate p-values |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
170 | (1) |
|
15.3 Two-sample f-test for means |
|
|
171 | (8) |
|
|
171 | (1) |
|
15.3.2 Set significance level |
|
|
172 | (1) |
|
15.3.3 Collect and summarize data |
|
|
172 | (1) |
|
15.3.4 Calculate the test statistic |
|
|
173 | (2) |
|
15.3.5 Calculate p-values |
|
|
175 | (2) |
|
|
177 | (1) |
|
|
178 | (1) |
|
15.4 Paired t-test for means |
|
|
179 | (6) |
|
|
180 | (1) |
|
15.4.2 Set significance level |
|
|
181 | (1) |
|
15.4.3 Collect and summarize data |
|
|
181 | (1) |
|
15.4.4 Calculate the test statistic |
|
|
182 | (1) |
|
15.4.5 Calculating p-values |
|
|
182 | (1) |
|
|
183 | (1) |
|
|
184 | (1) |
|
|
185 | (2) |
|
16 Confidence intervals for two parameters |
|
|
|
|
187 | (1) |
|
16.2 Confidence interval for p1 -- p2 |
|
|
187 | (4) |
|
|
191 | (1) |
|
16.3 Confidence interval for μ1 - μ2 |
|
|
191 | (6) |
|
|
192 | (1) |
|
|
193 | (2) |
|
16.3.3 Interpretation and example |
|
|
195 | (1) |
|
|
196 | (1) |
|
16.4 Confidence intervals for μD |
|
|
197 | (2) |
|
|
198 | (1) |
|
16.5 Confidence intervals for μ1-μ2 and hypothesis testing |
|
|
199 | (2) |
|
|
201 | (1) |
|
|
201 | (2) |
|
17 R tutorial: statistical inference in R |
|
|
|
|
203 | (1) |
|
17.2 Choosing the right test |
|
|
203 | (1) |
|
17.3 Inference for proportions |
|
|
204 | (5) |
|
17.3.1 Inference for a single proportion |
|
|
205 | (2) |
|
17.3.2 Inference for two proportions |
|
|
207 | (1) |
|
|
208 | (1) |
|
|
209 | (4) |
|
17.4.1 Inference for a single mean |
|
|
209 | (1) |
|
17.4.2 Inference for two means |
|
|
210 | (2) |
|
17.4.3 Paired inference for means |
|
|
212 | (1) |
|
|
213 | (1) |
|
|
213 | (2) |
|
18 Inference for two quantitative variables |
|
|
|
|
215 | (1) |
|
18.2 Test for correlations |
|
|
216 | (6) |
|
|
216 | (1) |
|
18.2.2 Set significance level |
|
|
217 | (1) |
|
18.2.3 Collect and summarize data |
|
|
217 | (1) |
|
18.2.4 Calculate the test statistic |
|
|
217 | (1) |
|
18.2.5 Calculate p-values |
|
|
218 | (1) |
|
|
219 | (2) |
|
|
221 | (1) |
|
18.3 Confidence intervals for correlations |
|
|
222 | (1) |
|
18.4 Test for correlations in R |
|
|
223 | (1) |
|
18.5 Confidence intervals for correlations |
|
|
224 | (1) |
|
|
224 | (1) |
|
|
225 | (2) |
|
19 Simple linear regression |
|
|
|
|
227 | (1) |
|
|
228 | (1) |
|
19.3 The simple linear regression model |
|
|
229 | (1) |
|
19.4 Estimating the regression model |
|
|
230 | (2) |
|
|
232 | (2) |
|
|
234 | (1) |
|
19.7 Using regression to create predictions |
|
|
234 | (1) |
|
|
235 | (1) |
|
19.9 The assumptions of regression |
|
|
236 | (4) |
|
19.9.1 Assumption 1: linearity |
|
|
236 | (3) |
|
19.9.2 Assumption 2: independence |
|
|
239 | (1) |
|
19.9.3 Assumption 3: zero mean |
|
|
239 | (1) |
|
19.9.4 Assumption 4: homoskedasticity |
|
|
239 | (1) |
|
19.10 Inference for regression |
|
|
240 | (4) |
|
|
240 | (1) |
|
19.10.2 Set significance level |
|
|
241 | (1) |
|
19.10.3 Collect and summarize data |
|
|
241 | (1) |
|
19.10.4 Calculate our test statistic |
|
|
241 | (1) |
|
19.10.5 Calculate p-values |
|
|
242 | (1) |
|
|
243 | (1) |
|
19.10.7 Inference for regression in R |
|
|
243 | (1) |
|
19.11 How good is our regression? |
|
|
244 | (3) |
|
|
247 | (1) |
|
|
247 | (2) |
|
20 Statistics: the world beyond this book |
|
|
|
20.1 Questions beyond the techniques of this book |
|
|
249 | (3) |
|
20.2 The answers statistics gives |
|
|
252 | (2) |
|
20.3 Where does this leave us? |
|
|
254 | (17) |
|
A Solutions to practice problems |
|
|
|
|
References |
|
271 | (6) |
Index |
|
277 | |