|
|
xiii | |
|
|
xv | |
Preface |
|
xvii | |
Preface to the Original Book |
|
xix | |
|
|
1 | (31) |
|
|
3 | (4) |
|
|
7 | (1) |
|
1.3 Introduction to Stata |
|
|
8 | (18) |
|
1.3.1 Arithmetic Operations |
|
|
9 | (1) |
|
|
10 | (6) |
|
|
16 | (2) |
|
1.3.4 Describing the Data |
|
|
18 | (2) |
|
|
20 | (1) |
|
1.3.6 Merging Data Sets in Stata |
|
|
21 | (2) |
|
|
23 | (2) |
|
1.3.8 Programming and Learning Tips |
|
|
25 | (1) |
|
|
26 | (1) |
|
|
27 | (5) |
|
1.5.1 Bias in Self-Reported Turnout |
|
|
27 | (1) |
|
1.5.2 Understanding World Population Dynamics |
|
|
28 | (4) |
|
|
32 | (49) |
|
2.1 Racial Discrimination in the Labor Market |
|
|
32 | (6) |
|
2.2 Subsetting the Data in Stata |
|
|
38 | (9) |
|
2.2.1 Relational Operators |
|
|
38 | (1) |
|
|
39 | (1) |
|
2.2.3 Simple Conditional Statements and Variable Creation |
|
|
40 | (3) |
|
2.2.4 Subsetting Using Conditions |
|
|
43 | (1) |
|
2.2.5 Preserving and Transforming Data Sets |
|
|
44 | (3) |
|
2.3 Causal Effects and the Counterfactual |
|
|
47 | (2) |
|
2.4 Randomized Controlled Trials |
|
|
49 | (7) |
|
2.4.1 The Role of Randomization |
|
|
50 | (1) |
|
2.4.2 Social Pressure and Voter Turnout |
|
|
51 | (5) |
|
2.5 Observational Studies |
|
|
56 | (11) |
|
2.5.1 Minimum Wage and Unemployment |
|
|
56 | (4) |
|
|
60 | (3) |
|
2.5.3 Before-and-After and Difference-in-Differences Designs |
|
|
63 | (4) |
|
2.6 Descriptive Statistics for a Single Variable |
|
|
67 | (8) |
|
|
67 | (5) |
|
|
72 | (3) |
|
|
75 | (1) |
|
|
75 | (6) |
|
2.8.1 Efficacy of Small Class Size in Early Education |
|
|
75 | (2) |
|
2.8.2 Changing Minds on Gay Marriage |
|
|
77 | (2) |
|
2.8.3 Success of Leader Assassination as a Natural Experiment |
|
|
79 | (2) |
|
|
81 | (47) |
|
3.1 Measuring Civilian Victimization during Wartime |
|
|
81 | (3) |
|
3.2 Handling Missing Data in Stata |
|
|
84 | (2) |
|
|
85 | (1) |
|
3.3 Visualizing the Univariate Distribution |
|
|
86 | (10) |
|
|
87 | (2) |
|
|
89 | (3) |
|
|
92 | (2) |
|
3.3.4 Printing and Saving Graphs |
|
|
94 | (2) |
|
|
96 | (9) |
|
3.4.1 The Role of Randomization |
|
|
96 | (5) |
|
3.4.2 Nonresponse and Other Sources of Bias |
|
|
101 | (4) |
|
3.5 Measuring Political Polarization |
|
|
105 | (1) |
|
3.6 Summarizing Bivariate Relationships |
|
|
106 | (11) |
|
|
106 | (3) |
|
|
109 | (5) |
|
3.6.3 Quantile--Quantile Plot |
|
|
114 | (3) |
|
|
117 | (4) |
|
3.7.1 The k-Means Algorithm |
|
|
117 | (4) |
|
|
121 | (1) |
|
|
122 | (6) |
|
3.9.1 Changing Minds on Gay Marriage: Revisited |
|
|
122 | (1) |
|
3.9.2 Political Efficacy in China and Mexico |
|
|
123 | (2) |
|
3.9.3 Voting in the United Nations General Assembly |
|
|
125 | (3) |
|
|
128 | (69) |
|
4.1 Predicting Election Outcomes |
|
|
128 | (16) |
|
|
129 | (2) |
|
|
131 | (2) |
|
|
133 | (11) |
|
|
144 | (23) |
|
4.2.1 Facial Appearance and Election Outcomes |
|
|
144 | (2) |
|
4.2.2 Correlation and Scatterplots |
|
|
146 | (2) |
|
|
148 | (6) |
|
4.2.4 Regression toward the Mean |
|
|
154 | (6) |
|
|
160 | (7) |
|
4.3 Regression and Causation |
|
|
167 | (23) |
|
4.3.1 Randomized Experiments |
|
|
167 | (4) |
|
4.3.2 Regression with Multiple Predictors |
|
|
171 | (6) |
|
4.3.3 Heterogeneous Treatment Effects |
|
|
177 | (7) |
|
4.3.4 Regression Discontinuity Design |
|
|
184 | (6) |
|
|
190 | (1) |
|
|
190 | (7) |
|
4.5.1 Prediction Based on Betting Markets |
|
|
190 | (3) |
|
4.5.2 Election and Conditional Cash Transfer Program in Mexico |
|
|
193 | (2) |
|
4.5.3 Government Transfer and Poverty Reduction in Brazil |
|
|
195 | (2) |
|
|
197 | (79) |
|
|
197 | (13) |
|
5.1.1 Frequentist versus Bayesian |
|
|
197 | (2) |
|
5.1.2 Definition and Axioms |
|
|
199 | (3) |
|
|
202 | (3) |
|
5.1.4 Sampling with and without Replacement |
|
|
205 | (3) |
|
|
208 | (2) |
|
5.2 Conditional Probability |
|
|
210 | (31) |
|
5.2.1 Conditional, Marginal, and Joint Probabilities |
|
|
210 | (8) |
|
|
218 | (8) |
|
|
226 | (2) |
|
5.2.4 Predicting Race Using Surname and Residence Location |
|
|
228 | (13) |
|
5.3 Random Variables and Probability Distributions |
|
|
241 | (23) |
|
|
241 | (1) |
|
5.3.2 Bernoulli and Uniform Distributions |
|
|
241 | (5) |
|
5.3.3 Binomial Distribution |
|
|
246 | (3) |
|
5.3.4 Normal Distribution |
|
|
249 | (7) |
|
5.3.5 Expectation and Variance |
|
|
256 | (4) |
|
5.3.6 Predicting Election Outcomes with Uncertainty |
|
|
260 | (4) |
|
5.4 Large Sample Theorems |
|
|
264 | (7) |
|
5.4.1 The Law of Large Numbers |
|
|
264 | (2) |
|
5.4.2 The Central Limit Theorem |
|
|
266 | (5) |
|
|
271 | (1) |
|
|
272 | (4) |
|
5.6.1 The Mathematics of Enigma |
|
|
272 | (2) |
|
5.6.2 A Probability Model for Betting Market Election Prediction |
|
|
274 | (2) |
|
|
276 | (88) |
|
|
276 | (31) |
|
6.1.1 Unbiasedness and Consistency |
|
|
277 | (8) |
|
|
285 | (5) |
|
6.1.3 Confidence Intervals |
|
|
290 | (6) |
|
6.1.4 Margin of Error and Sample Size Calculation in Polls |
|
|
296 | (5) |
|
6.1.5 Analysis of Randomized Controlled Trials |
|
|
301 | (3) |
|
6.1.6 Analysis Based on Student's t-Distribution |
|
|
304 | (3) |
|
|
307 | (29) |
|
6.2.1 Tea-Tasting Experiment |
|
|
307 | (6) |
|
6.2.2 The General Framework |
|
|
313 | (3) |
|
|
316 | (6) |
|
|
322 | (5) |
|
6.2.5 Pitfalls of Hypothesis Testing |
|
|
327 | (2) |
|
|
329 | (7) |
|
6.3 Linear Regression Model with Uncertainty |
|
|
336 | (20) |
|
6.3.1 Linear Regression as a Generative Model |
|
|
337 | (6) |
|
6.3.2 Unbiasedness of Estimated Coefficients |
|
|
343 | (2) |
|
6.3.3 Standard Errors of Estimated Coefficients |
|
|
345 | (3) |
|
6.3.4 Inference about Coefficients |
|
|
348 | (2) |
|
6.3.5 Inference about Predictions |
|
|
350 | (6) |
|
|
356 | (1) |
|
|
357 | (7) |
|
6.5.1 Sex Ratio and the Price of Agricultural Crops in China |
|
|
357 | (2) |
|
6.5.2 Filedrawer and Publication Bias in Academic Research |
|
|
359 | (2) |
|
6.5.3 The 1932 German Election in the Weimar Republic |
|
|
361 | (3) |
|
|
364 | (65) |
|
|
364 | (22) |
|
7.1.1 Marriage Network in Renaissance Florence |
|
|
365 | (2) |
|
7.1.2 Undirected Graph and Centrality Measures |
|
|
367 | (8) |
|
7.1.3 Twitter Following Network |
|
|
375 | (1) |
|
7.1.4 Directed Graph and Centrality |
|
|
376 | (10) |
|
|
386 | (14) |
|
7.2.1 The 1854 Cholera Outbreak in London |
|
|
386 | (3) |
|
7.2.2 Spatial Data in Stata |
|
|
389 | (4) |
|
7.2.3 United States Presidential Elections |
|
|
393 | (2) |
|
7.2.4 Expansion of Walmart |
|
|
395 | (2) |
|
|
397 | (3) |
|
|
400 | (20) |
|
7.3.1 The Disputed Authorship of The Federalist Papers |
|
|
400 | (4) |
|
|
404 | (7) |
|
7.3.3 Document-Term Matrix and Clusters |
|
|
411 | (2) |
|
7.3.4 Authorship Prediction |
|
|
413 | (4) |
|
|
417 | (3) |
|
|
420 | (1) |
|
|
420 | (9) |
|
7.5.1 International Trade Network |
|
|
420 | (2) |
|
7.5.2 Mapping US Presidential Election Results over Time |
|
|
422 | (2) |
|
7.5.3 Analyzing the Preambles of Constitutions |
|
|
424 | (5) |
|
|
429 | (4) |
General Index |
|
433 | (6) |
Stata Index |
|
439 | (4) |
Stata Command Abbreviation List |
|
443 | |