Preface

About the Author

**Chapter 1. Stata Basics**

1.1 Introduction to Stata

1.1.1. Do You Still Need to Use Commands?

1.1.2. Stata at First Sight: Interface, Menus, and Toolbar

1.1.3. Creating a File and Entering Data

1.1.4. How to Open an Existing Data File

1.1.5. The Structure of Stata Commands

1.1.6. Do-Files

1.1.7. How to Save Stata Results

1.1.8. What If I have a Question? How Do I Get Help?

1.2 Data Management

1.2.1. Creating a New Variable

1.2.2. Recoding a Variable

1.2.3. Labeling a Variable

1.2.4. Labeling Values

1.2.5. The **egen** Command

1.2.6. How to Deal With Missing Values When Recoding Variables

1.2.7. Other Useful Data Management Commands

1.3 Graphs

1.3.1. Histograms

1.3.2. Bar Charts

1.3.3. Box Plots

1.3.4. Scatter Plots

1.3.5. How to Save Graphs

1.3.6. Stata Graph Editor

1.4 Summary of Stata Commands in This Chapter

1.5 Exercises

**Chapter 2. Review of Basic Statistics**

2.1 Understand Your Data Using Descriptive Statistics

2.2 Descriptive Statistics for Continuous Variables Using Stata

2.3 Frequency Distribution for Categorical Variables Using Stata

2.4 Independent Samples *t* Test Using Stata

2.5 Paired-Samples *t* Test

2.6 Analysis of Variance (ANOVA)

2.7 Correlation

2.8 Simple Linear Regression

2.9 Multiple Linear Regression

2.10 Chi-Square Test

2.11 Making Publication-Quality Tables Using Stata

2.12 General Guidelines for Reporting Results

2.13 Summary of Stata Commands in This Chapter

2.14 Exercises

**3. Logistic Regression for Binary Data**

3.1 Logistic Regression Models: An Introduction

3.1.1. Why Do We Need a Logistic Transformation?

3.1.2. Probabilities, Odds, and Odds Ratios

3.1.3. Transformation Among Probabilities, Odds, and Log Odds in Logistic Regression

3.1.4. Goodness-of-Fit Statistics

3.1.5. Testing Significance of Predictors

3.1.6. Interpretation of Model Parameter Estimates in Logistic Regression

3.2 Research Example and Description of the Data and Sample

3.3 Logistic Regression With Stata: Commands and Output

3.3.1. Simple Logistic Regression Using Stata

3.3.2. Multiple Logistic Regression

3.4 Making Publication-Quality Tables

3.5 Reporting the Results

3.6 Summary of Stata Commands in This Chapter

3.7 Exercises

**4. Proportional Odds Models for Ordinal Response Variables
**

4.1 Proportional Odds Models: An Introduction

4.1.1. Odds and Odds Ratios in PO Models

4.1.2. Brant Test of the PO Assumption

4.1.3. Goodness of Fit

4.1.4. Interpretation of Model Parameter Estimates

4.2 Research Example and Description of the Data and Sample

4.3 Proportional Odds Models With Stata: Commands and Output

4.3.1. The PO Model: One-Predictor Model

4.3.2. The PO Model: Multiple-Predictor Model

4.3.3. Model Comparisons Using the Log Likelihood Ratio Test and Other Fit Statistics

4.4 Making Publication-Quality Tables

4.5 Reporting the Results

4.6 Summary of Stata Commands in This Chapter

4.7 Exercises

**5. Partial Proportional Odds Models and Generalized Ordinal Logistic Regression Models**

5.1 Partial Proportional Odds Models and Generalized Ordinal Logistic Regression Models: An Introduction

5.1.1. Odds and Odds Ratios

5.1.2. Goodness of Fit

5.1.3. Interpretation of Model Parameter Estimates

5.2 Research Example and Description of the Data and Sample

5.3 Partial Proportional Odds Models and Generalized Ordinal Logistic Models With Stata: Commands and Output

5.3.1. Stata Commands and Output

5.4 Generalized Ordinal Logistic Regression Models With Stata: An Example

5.4.1. Stata Commands and Output

5.5 Making Publication-Quality Tables

5.6 Reporting the Results

5.7 Summary of Stata Commands in This Chapter

5.8 Exercises

**6. Continuation Ratio Models**

6.1 Continuation Ratio Models: An Introduction

6.1.1. Conditional Probabilities, Odds, and Odds Ratios

6.1.2. Goodness-of-Fit Statistics

6.1.3. Interpretation of Model Parameter Estimates

6.2 Research Example and Description of the Data and Sample

6.3 Continuation Ratio Models With Stata: Commands and Output

6.3.1. The CR Model With the **logit** Link: One-Predictor Model

6.3.2. The CR Model With the **logit** Link: Multiple-Predictor Model

6.3.3. Fitting Continuation Ratio Models Using the **seqlogit** Command

6.4 Making Publication-Quality Tables

6.5 Reporting the Results

6.6 Summary of Stata Commands in This Chapter

6.7 Exercises

**7. Adjacent Categories Logistic Regression Models**

7.1 Adjacent Categories Models: An Introduction

7.1.1. Odds and Odds Ratios in AC Models

7.1.2. Goodness-of-Fit Statistics

7.1.3. Interpretation of Model Parameter Estimates

7.1.4. From the Multinomial Logistic Model to the AC model

7.2 Research Example and Description of the Data and Sample

7.3 Adjacent Categories Models With Stata: Commands and Output

7.3.1. Multinomial Logistic Regression Using Stata

7.3.2. Single-Predictor AC Model Using Stata

7.3.3. Making Publication-Quality Tables for the Single-Predictor AC Model

7.3.4. Adjacent Categories Models With Stata: Multiple-Predictor Model

7.3.5. Making Publication-Quality Tables for the Multiple-Predictor Model

7.4 Reporting the Results

7.5 Summary of Stata Commands in This Chapter

7.6 Exercises

**8. Stereotype Logistic Regression Models**

8.1 Stereotype Logistic Regression Models: An Introduction

8.1.1. Odds and Odds Ratios in Stereotype Logistic Regression Models

8.1.2. Model Fit Statistics

8.1.3. Interpretation of Model Parameter Estimates

8.2 Research Example and Description of the Data and Sample

8.3 Stereotype Logistic Regression Models With Stata: Commands and Output

8.3.1. The SL Model: One-Predictor Model

8.3.2. The SL Model: Multiple-Predictor Model

8.3.3. Model Comparisons Using the Log Likelihood Ratio Test

8.4 Making Publication-Quality Tables

8.5 Reporting the Results

8.6 Summary of Stata Commands in This Chapter

8.7 Exercises

**9. Ordinal Logistic Regression With Complex Survey Sampling Designs**

9.1 Proportional Odds Models With Complex Survey Sampling Designs: An Introduction

9.1.1. Features of Complex Surveys

9.1.2. Variance Estimation in Complex Survey Sampling

9.2 Research Example and Description of the Data and Sample

9.3 Data Analysis With Stata: Commands and Output

9.3.1. Proportional Odds Model With Four Explanatory Variables Without Weights

9.3.2. Proportional Odds Model With Weights

9.3.3. Proportional Odds Model for Complex Survey Data Using the Stata **svy** Command

9.3.4. How to Deal With Singleton Strata

9.4 Making Publication-Quality Tables

9.5 Reporting the Results

9.6 Summary of Stata Commands in This Chapter

9.7 Exercises

**10. Multilevel Modeling for Continuous and Binary Response Variables**

10.1 Multilevel Modeling: An Introduction

10.1.1. Multilevel Data Structure

10.1.2. Intraclass Correlation

10.1.3. Overview of a Basic Two-Level Model

10.1.4. Model-Building Strategies

10.1.5. Model Fit Statistics

10.1.6. Centering

10.1.7. Data Structure for Model Fitting

10.2 Multilevel Modeling for Continuous Outcome Variables

10.2.1. Research Example and Research Questions

10.2.2. Description of the Data and Sample

10.2.3. Multilevel Modeling for Continuous Outcome Variables With Stata: Commands and Output

10.2.4. Making Publication-Quality Tables

10.2.5. Reporting the Results

10.3 Multilevel Modeling for Binary Outcome Variables

10.3.1. Odds and Odds Ratios in Multilevel Logistic Regression Models

10.3.2. Research Example and Research Questions

10.3.3. Description of the Data and Sample

10.3.4. Multilevel Modeling for Binary Outcome Variables With Stata: Commands and Output

10.3.5. Making Publication-Quality Tables

10.3.6. Reporting the Results

10.4 Summary of Stata Commands in This Chapter

10.5 Exercises

**11. Multilevel Modeling for Ordinal Response Variables**

11.1 Multilevel Modeling for Ordinal Response Variables: An
Introduction

11.1.1. Model Specification

11.1.2. Odds and Odds Ratios in Multilevel PO Models

11.1.3. Likelihood Ratio Test

11.2 Research Example: Research Problem and Questions

11.2.1. Description of the Data and Sample

11.3 Multilevel Modeling for Ordinal Response Variables With Stata: Commands and Output

11.3.1. Unconditional Model or Null Model (Model 1)

11.3.2. Random-Intercept Model (Model 2)

11.3.3. Random-Coefficient Model With a Level 1 Variable (Model 3)

11.3.4. Contextual Model With Both Level 1 and Level 2 Variables (Model 4)

11.3.5. Contextual Model With Cross-Level Interactions (Model 5)

11.3.6. Model Comparisons Using the AIC and BIC Statistics

11.3.7. Computing the Estimated Probabilities With the **margins** Command

11.3.8. Fitting Multilevel PO Models Using the **meglm** Command

11.3.9. Fitting Multilevel PO Models Using the **gllamm** Command

11.4 Making Publication-Quality Tables

11.5 Reporting the Results

11.6 Summary of Stata Commands in This Chapter

11.7 Exercises

**12. Beyond Ordinal Logistic Regression Models: Ordinal Probit Regression Models and Multinomial Logistic Regression Models**

12.1 Ordinal Probit Regression Models

12.1.1. Ordinal Probit Regression Models: An Introduction

12.1.2. Description of the Research Example, Data, and Sample

12.1.3. Ordinal Probit Models With Stata: Commands and Output

12.1.4. Interpreting the Output

12.1.5. Interpreting the Marginal Effects With the **margins** Command

12.1.6. Computing the Marginal Effects With the Improved **margins** Command in Stata 14

12.1.7. Interpreting the Estimated Probabilities With the **margins** Command

12.1.8. Model Comparison Using the Log Likelihood Ratio Test

12.1.9. Making Publication-Quality Tables Comparing the Probit Model and Proportional Odds Model

12.1.10. Reporting the Results

12.2 Multinomial Logistic Regression Models

12.2.1. Multinomial Logistic Regression Models: An Introduction

12.2.2. Odds in Multinomial Logistic Models

12.2.3. Odds Ratios or Relative Risk Ratios in Multinomial Logistic Regression Models

12.2.4. Description of the Research Example, Data, and Sample

12.2.5. Multinomial Logistic Regression Models With Stata: Commands and Output

12.2.6. Interpreting the Output

12.2.7. Interpreting the Odds Ratios of Being in a Category **j** Versus the Base Category 1

12.2.8. Interpreting the Estimated Probabilities With the **margins** Command

12.2.9. Independence of Irrelevant Alternatives (IIA) Tests

12.2.10. Making Publication-Quality Tables

12.2.11. Reporting the Results

12.3 Summary of Stata Commands in This Chapter

12.4 Exercises

**Key Formulas for Statistical Models**

**Appendix: List of Stata User-Written Commands**

**References**

**Index**