Preface

Notes on the Eighth Edition

Acknowledgments

1 Stata and Stata Resources

A Typographical Note

An Example Stata Session

Stata’s Documentation and Help Files

Searching for Information

StataCorp

The *Stata Journal*

Books Using Stata

2 Data Management

Example Commands

Creating a New Dataset by Typing in Data

Creating a New Dataset by Copy and Paste

Specifying Subsets of the Data: **in** and **if** Qualifiers

Generating and Replacing Variables

Missing Value Codes

Using Functions

Converting Between Numeric and String Formats

Creating New Categorical and Ordinal Variables

Using Explicit Subscripts with Variables

Importing Data from Other Programs

Combining Two or More Stata Files

Collapsing Data

Reshaping Data

Using Weights

Creating Random Data and Random Samples

Writing Programs for Data Management

3 Graphs

Example Commands

Histograms

Box Plots

Scatterplots and Overlays

Line Plots and Connected-Line Plots

Other Twoway Plot Types

Bar Charts and Pie Charts

Symmetry and Quantile Plots

Adding Text to Graphs

Graphing with Do-Files

Retrieving and Combining Graphs

Graph Editor

Creative Graphing

4 Survey Data

Example Commands

Declare Survey Data

Design Weights

Poststratification Weights

Survey-Weighted Tables and Graphs

Bar Charts for Multiple Comparisons

5 Summary Statistics and Tables

Example Commands

Summary Statistics for Measurement Variables

Exploratory Data Analysis

Normality Tests and Transformations

Frequency Tables and Two-Way Cross-Tabulations

Multiple Tables and Multi-Way Cross-Tabulations

Tables of Means, Medians and Other Summary Statistics

Using Frequency Weights

6 ANOVA and Other Comparison Methods

Example Commands

One-Sample Tests

Two-Sample Tests

One-Way Analysis of Variance (ANOVA)

Two- and *N*-Way Analysis of Variance

Factor Variables and Analysis of Covariance (ANCOVA)

Predicted Values and Error-Bar Charts

7 Linear Regression Analysis

Example Commands

Simple Regression

Correlation

Multiple Regression

Hypothesis Tests

Dummy Variables

Interaction Effects

Robust Estimates of Variance

Predicted Values and Residuals

Other Case Statistics

Diagnosing Multicollinearity and Heteroskedasticity

Confidence Bands in Simple Regression

Diagnostic Graphs

8 Advanced Regression Methods

Example Commands

Lowess Smoothing

Robust Regression

Further **rreg** and **qreg** Applications

Nonlinear Regression — 1

Nonlinear Regression — 2

Box–Cox Regression

Multiple Imputation of Missing Values

Structural Equation Modeling

9 Logistic Regression

Example Commands

Space Shuttle Data

Using Logistic Regression

Marginal or Conditional Effects Plots

Diagnostic Statistics and Plots

Logistic Regression with Ordered-Category *y*

Multinomial Logistic Regression

Multiple Imputation of Missing Values — Logit Regression Example

10 Survival and Event-Count Models

Example Commands

Survival-Time Data

Count-Time Data

Kaplan–Meier Survivor Functions

Cox Proportional Hazard Models

Exponential and Weibull Regression

Poisson Regression

Generalized Linear Models

11 Principal Component, Factor and Cluster Analysis

Example Commands

Principal Component Analysis and Principal Component Factoring

Rotation

Factor Scores

Principal Factoring

Maximum-Likelihood Factoring

Cluster Analysis — 1

Cluster Analysis — 2

Using Factor Scores in Regression

Measurement and Structural Equation Models

12 Time Series Analysis

Example Commands

Smoothing

Further Time Plot Examples

Recent Climate Change

Leads, Lags and Differences

Correlograms

ARIMA Models

ARMAX Models

13 Multilevel and Mixed-Effects Modeling

Example Commands

Regression with Random Intercepts

Random Intercepts and Slopes

Multiple Random Slopes

Nested Levels

Repeated Measurements

Cross-Sectional Time Series

Mixed-Effects Logit Regression

14 Introduction to Programming

Basic Concepts and Tools

Do-files

Ado-files

Programs

Local macros

Global macros

Scalars

Version

Comments

Looping

If ... else

Arguments

Syntax

Example Program:

**multicat** (Plot Many Categorical Variables)

Using

**multicat**
Help File

Monte Carlo Simulation

Matrix Programming with Mata

Dataset Sources

References

Index