Figures

Preface

Getting Started

Dataset CD

Notes

Chapter 1 Introduction to Stata

Commands Covered: describe; codebook *varname*; set more off; File → Log → Begin;
search *keyword*; help *command_name*; which *package_name*;
ssc install *package_name*

Obtaining Information about a Dataset

Obtaining Information about Variables

Creating and Viewing a Log File

Printing Results and Copying Output

Getting Help

Installing Statistical Modules

Exercises

Notes

Chapter 2 Descriptive Statistics

Commands Covered: tabulate *varname*; summarize *varname*, detail; sktest *varname*;
histogram *varname*, d percent; histogram *varname*, percent; sort *varname*;
list *varname*; The Graph Editor Recorder

Interpreting Measures of Central Tendency and Variation

Describing Nominal Variables

Describing Ordinal Variables

Describing Interval Variables

Obtaining Bar Charts and Histograms

Creating Bar Charts

A Closer Look: Graph Editor Recorder

Creating Histograms

Obtaining Case-level Information with sort and list

Exercises

Notes

Chapter 3 Transforming Variables

Commands Covered: recode, generate(); generate, recode(); xtile, nquantiles();
generate; tabulate, generate(); label variable; label define;
label values; drop; aorder

A Workbook Convention: Weighting the nes2008 Dataset

Transforming Categorical Variables

Transforming Interval Variables

A Closer Look: The xtile Command

The label define and label values Commands

Creating an Additive Index

Creating Indicator Variables

Exercises

Notes

Chapter 4 Making Comparisons

Commands Covered: tabulate *dep_var indep_var*, column; tabulate *indep_var*,
summarize (*dep_var*); format; _gwtmean, *dep_var_mean=dep_var* [if],
by (*indep_var*); if; twoway (line *dep_var indep_var*, sort); replace;
graph bar (mean) *dep_var*, over (*indep_var*)

Cross-tabulation Analysis

Mean Comparison Analysis

Visualizing Relationships with Line Charts and Bar Charts

A Closer Look: The format Command

Graphing an Interval-level Dependent Variable

A Closer Look: The if Qualifier

Graphing a Categorical Dependent Variable

A Closer Look: The replace Command

Exercises

Notes

Chapter 5 Making Controlled Comparisons

Commands Covered: bysort *cntrl_var:* tabulate *dep_var indep_var*,
col; tabulate *cntrl_var indep_var*, summarize (*dep_var*);
graph bar *dep_var*, over (*cntrl_var*) over
(*indep_var*); twoway (line *dep_var indep_var* if
*cntrl_var*==value1, sort) (line *dep_var indep_var*
if *cntrl_var*==value2, sort)

Cross-tabulation Analysis with a Control Variable

Bar Charts for Controlled Comparisons with a Categorical Dependent Variable

Mean Comparison Analysis with a Control Variable

Line Charts for Controlled Comparisons with an Interval-level Dependent Variable

Exercises

Notes

Chapter 6 Making Inferences about Sample Means

Commands Covered: ttest *varname* = *testvalue*; ttest *varname*,
by(*group_var*); robvar *varname*, by(*group_var*)

Describing a Sample Mean

Testing the Difference Between Two Sample Means

Exercises

Notes

Chapter 7 Chi-square and Measures of Association

Commands Covered: (tabulate option) chi2; (tabulate option) V; somersd *indep_var dep_var*;
lambda *dep_var indep_var*

Analyzing Ordinal-level Relationships

Analyzing Nominal-level Relationships

A Problem with Lambda

Exercises

Notes

Chapter 8 Correlation and Linear Regression

Commands Covered: correlate *varlist*; regress *dep_var indep_var(s)*;
twoway (*scatter dep_var indep_var*)
(lfit *dep_var indep_var*)

A Closer Look: R-squared and Adjusted R-squared: What’s the Difference?

Creating a Scatterplot with a Linear Prediction Line

Exploring Multivariate Relationships with Regression

Exercises

Notes

Chapter 9 Dummy Variables and Interaction Effects

Commands Covered: xi: regression *dep_var i.indep_var*;
char *varname* [omit] #; test *varname1* =
*varname2*; predict *newvar*

Regression with Dummy Variables

A Closer Look: The test Command

Interaction Effects in Multiple Regression

Graphing Linear Prediction Lines for Interaction Relationships

Exercises

Notes

Chapter 10 Logistic Regression

Commands Covered: logit *dep_var indep_var(s)*; logistic *dep_var indep_var(s)*,
*[coef]*; estimates store *name*; lrtest *name*, force;
adjust *indep_var1*, by(*indep_var2*) pr
gen(*newvar*); quietly; tabstat *dep_var1 dep_var2*, by(*indep_var*)

The logit Command and the logistic Command

Logistic Regression with Multiple Independent Variables

A Closer Look: The estimates Command and the lrtest Command

Working with Predicted Probabilities: Models with One Independent Variable

Working with Predicted Probabilities: Models with Multiple Independent Variables

Exercises

Notes

Chapter 11 Doing Your Own Political Analysis

Five Doable Ideas

Political Knowledge

Economic Performance and Election Outcomes

State Courts and Criminal Procedure

Electoral Turnout in Comparative Perspective

Congress

Inputting Data

Stata-formatted Datasets

Microsoft Excel Datasets

PDF Format or Hand-coded Data

Writing It Up

The Research Question

Previous Research

Data, Hypotheses, and Analysis

Conclusions and Implications

Notes

Appendix

Table A-1: Descriptions of Constructed Variables in gss2006

Table A-2: Descriptions of Variables in the states Dataset

Table A-3: Descriptions of Variables in the world Dataset