Stata for the Behavioral Sciences

Stata for the Behavioral Sciences, by Michael Mitchell, is the ideal reference for researchers using Stata to fit ANOVA models and other models commonly applied to behavioral science data. Drawing on his education in psychology and his experience in consulting, Mitchell uses terminology and examples familiar to the reader as he demonstrates how to fit a variety of models, how to interpret results, how to understand simple and interaction effects, and how to explore results graphically.

 

Although this book is not designed as an introduction to Stata, it is appealing even to Stata novices. Throughout the text, Mitchell thoughtfully addresses any features of Stata that are important to understand for the analysis at hand. He also is careful to point out additional resources such as related videos from Stata’s YouTube channel.

 

The book is divided into five sections.

 

The first section contains a chapter that introduces Stata commands for descriptive statistics and another that covers basic inferential statistics such as one- and two-sample t tests.

 

The second section focuses on between-subjects ANOVA modeling. The discussion moves from one-way ANOVA models to ANCOVA models to two-way and three-way ANOVA models. In each case, special attention is given to the use of commands such as contrast and margins for testing specific hypotheses of interest. Mitchell also emphasizes the understanding of interactions through contrasts and graphs. Underscoring the importance of planning any experiment, he discusses power analysis for t tests, for one- and two-way ANOVA models, and for ANCOVA models.

 

Section three of the book extends the discussion in the previous section to models for repeated-measures data and for longitudinal data.

 

The fourth section of the book illustrates the use of the regress command for fitting multiple regression models. Mitchell then turns his attention to tools for formatting regression output, for testing assumptions, and for model building. This section ends with a discussion of power analysis for simple, multiple, and nested regression models.

 

The final section has a tone that differs from the first four. Rather than focusing on a particular type of analysis, Mitchell describes elements of Stata. He first discusses estimation commands and similarities in syntax from command to command. Then, he details a set of postestimation commands that are available after most estimation commands. Another chapter provides an overview of data management commands. This section ends with a chapter that will be of particular interest to anyone who has used IBM® SPSS®; it lists commonly used SPSS® commands and provides equivalent Stata syntax.

 

This book is an easy-to-follow guide to analyzing data using Stata for researchers in the behavioral sciences and a valuable addition to the bookshelf of anyone interested in applying ANOVA methods to a variety of experimental designs.

Acknowledgments
List of tables
List of figures
Preface

 

I WARMING UP

 

1. INTRODUCTION

Read me first!

Downloading the example datasets and programs
Other user-written programs

The fre command
The esttab command
The extremes command

Why use Stata?

ANOVA
Supercharging your ANOVA
Stata is economical
Statistical powerhouse
Easy to learn
Simple and powerful data management
Access to user-written programs
Point and click or commands: Your choice
Powerful yet simple
Access to Stata source code
Online resources for learning Stata
And yet there is more!

Overview of the book

Part I: Warming up
Part II: Between-subjects ANOVA models
Part III: Repeated measures and longitudinal models
Part IV: Regression models
Part V: Stata overview
The GSS dataset
Language used in the book
Online resources for this book

Recommended resources and books

Getting started
Data management in Stata
Reproducing your results
Recommended Stata Press books

 

2. DESCRIPTIVE STATISTICS

Chapter overview
Using and describing the GSS dataset
One-way tabulations
Summary statistics
Summary statistics by one group
Two-way tabulations
Cross-tabulations with summary statistics
Closing thoughts

 

3. BASIC INFERENTIAL STATISTICS

Chapter overview
Two-sample t tests
Paired sample t tests
One-sample t tests
Two-sample test of proportions
One-sample test of proportions
Chi-squared and Fisher’s exact test
Correlations
Immediate commands

Immediate test of two means
Immediate test of one mean
Immediate test of two proportions
Immediate test of one proportion
Immediate cross-tabulations

Closing thoughts

 

II BETWEEN-SUBJECTS ANOVA MODELS

 

4. ONE-WAY BETWEEN-SUBJECTS ANOVA

Chapter overview
Comparing two groups using a t test
Comparing two groups using ANOVA

Computing effect sizes

Comparing three groups using ANOVA

Testing planned comparisons using contrast
Computing effect sizes for planned comparisons

Estimation commands and postestimation commands
Interpreting confidence intervals
Closing thoughts

 

5. CONTRASTS FOR A ONE-WAY ANOVA

Chapter overview
Introducing contrasts

Computing and graphing means
Making contrasts among means
Graphing contrasts
Options with the margins and contrast commands
Computing effect sizes for contrasts
Summary

Overview of contrast operators
Compare each group against a reference group

Selecting a specific contrast
Selecting a different reference group
Selecting a contrast and reference group

Compare each group against the grand mean

Selecting a specific contrast

Compare adjacent means

Reverse adjacent contrasts
Selecting a specific contrast

Comparing with the mean of subsequent and previous levels

Comparing with the mean of previous levels
Selecting a specific contrast

Polynomial contrasts
Custom contrasts
Weighted contrasts
Pairwise comparisons
Closing thoughts

 

6. ANALYSIS OF COVARIANCE

Chapter overview
Example 1: ANCOVA with an experiment using a pretest
Example 2: Experiment using covariates
Example 3: Observational data

Model 1: No covariates
Model 2: Demographics as covariates
Model 3: Demographics, socializing as covariates
Model 4: Demographics, socializing, health as covariates

Some technical details about adjusted means

Computing adjusted means: Method 1
Computing adjusted means: Method 2
Computing adjusted means: Method 3
Differences between method 2 and method 3
Adjusted means: Summary

Closing thoughts

 

7. TWO-WAY FACTORIAL BETWEEN-SUBJECTS ANOVA

Chapter overview
Two-by-two models: Example 1

Simple effects
Estimating the size of the interaction
More about interaction
Summary

Two-by-three models

Example 2

Simple effects
Simple contrasts
Partial interaction
Comparing optimism therapy with traditional therapy

Example 3

Simple effects
Partial interactions

Summary

Three-by-three models: Example 4

Simple effects
Simple contrasts
Partial interaction
Interaction contrasts
Summary

Unbalanced designs
Interpreting confidence intervals
Closing thoughts

 

8. ANALYSIS OF COVARIANCE WITH INTERACTIONS

Chapter overview
Example 1: IV has two levels

Question 1: Treatment by depression interaction
Question 2: When is optimism therapy superior?
Example 1: Summary

Example 2: IV has three levels

Questions 1a and 1b

Question 1a
Question 1b

Questions 2a and 2b

Question 2a
Question 2b

Overall interaction
Example 2: Summary

Closing thoughts

 

9. THREE-WAY BETWEEN-SUBJECTS ANALYSIS OF VARIANCE

Chapter overview
Two-by-two-by-two models

Simple interactions by season
Simple interactions by depression status
Simple effects

Two-by-two-by-three models

Simple interactions by depression status
Simple partial interaction by depression status
Simple contrasts
Partial interactions

Three-by-three-by-three models and beyond

Partial interactions and interaction contrasts
Simple interactions
Simple effects and simple contrasts

Closing thoughts

 

10. SUPERCHARGE YOUR ANALYSIS OF VARIANCE (via regression)

Chapter overview
Performing ANOVA tests via regression
Supercharging your ANOVA

Complex surveys
Homogeneity of variance
Robust regression
Quantile regression

Main effects with interactions: anova versus regress
Closing thoughts

 

11. POWER ANALYSIS FOR ANALYSIS OF VARIANCE AND COVARIANCE

Chapter overview
Power analysis for a two-sample t test

Example 1: Replicating a two-group comparison
Example 2: Using standardized effect sizes
Estimating effect sizes
Example 3: Power for a medium effect
Example 4: Power for a range of effect sizes
Example 5: For a given N, compute the effect size
Example 6: Compute effect sizes given unequal Ns

Power analysis for one-way ANOVA

Overview

Hypothesis 1. Traditional therapy versus control
Hypothesis 2: Optimism therapy versus control
Hypothesis 3: Optimism therapy versus traditional therapy Summary of hypotheses

Example 7: Testing hypotheses 1 and 2
Example 8: Testing hypotheses 2 and 3
Summary

Power analysis for ANCOVA

Example 9: Using pretest as a covariate
Example 10: Using correlated variables as covariates

Power analysis for two-way ANOVA

Example 11: Replicating a two-by-two analysis
Example 12: Standardized simple effects
Example 13: Standardized interaction effect
Summary: Power for two-way ANOVA

Closing thoughts

 

III REPEATED MEASURES AND LONGITUDINAL DESIGNS

 

12. REPEATED MEASURES DESIGNS

Chapter overview
Example 1: One-way within-subjects designs
Example 2: Mixed design with two groups
Example 3: Mixed design with three groups
Comparing models with different residual covariance structures
Example 1 revisited: Using compound symmetry
Example 1 revisited again: Using small-sample methods
An alternative analysis: ANCOVA
Closing thoughts

 

13. LONGITUDINAL DESIGNS

Chapter overview
Example 1: Linear effect of time
Example 2: Interacting time with a between-subjects IV
Example 3: Piecewise modeling of time
Example 4: Piecewise effects of time by a categorical predictor

Baseline slopes
Treatment slopes

Jump at treatment
Comparisons among groups at particular days
Summary of example 4

Closing thoughts

 

IV REGRESSION MODELS

 

14. SIMPLE AND MULTIPLE REGRESSION

Chapter overview
Simple linear regression

Decoding the output
Computing predicted means using the margins command
Graphing predicted means using the marginsplot command

Multiple regression

Describing the predictors
Running the multiple regression model
Computing adjusted means using the margins command
Describing the contribution of a predictor

One-unit change
Multiple-unit change
Milestone change in units
One SD change in predictor
Partial and semipartial correlation

Testing multiple coefficients

Testing whether coefficients equal zero
Testing the equality of coefficients
Testing linear combinations of coefficients

Closing thoughts

 

15. MORE DETAILS ABOUT THE REGRESS COMMAND

Chapter overview
Regression options
Redisplaying results
Identifying the estimation sample
Stored results
Storing results
Displaying results with the estimates table command
Closing thoughts

 

16. PRESENTING REGRESSION RESULTS

Chapter overview
Presenting a single model
Presenting multiple models
Creating regression tables using esttab

Presenting a single model with esttab
Presenting multiple models with esttab
Exporting results to other file formats

More commands for presenting regression results

outreg
outreg2
xml_tab
coefplot

Closing thoughts

 

17. TOOLS FOR MODEL BUILDING

Chapter overview
Fitting multiple models on the same sample
Nested models

Example 1: A simple example
Example 2: A more realistic example

Stepwise models
Closing thoughts

 

18. REGRESSION DIAGNOSTICS

Chapter overview
Outliers

Standardized residuals
Studentized residuals, leverage, Cook’s D
Graphs of residuals, leverage, and Cook’s D
DFBETAs and avplots
Running a regression with and without observations

Nonlinearity

Checking for nonlinearity graphically
Using scatterplots to check for nonlinearity
Checking for nonlinearity using residuals
Checking for nonlinearity using a locally weighted smoother
Graphing an outcome mean at each level of predictor
Summary
Checking for nonlinearity analytically

Adding power terms
Using factor variables

Multicollinearity
Homoskedasticity
Normality of residuals
Closing thoughts

 

19. POWER ANALYSIS FOR REGRESSION

Chapter overview
Power for simple regression
Power for multiple regression
Power for a nested multiple regression
Closing thoughts

 

V STATA OVERVIEW

 

20. COMMON FEATURES OF ESTIMATION COMMANDS

Chapter overview
Common syntax
Analysis using subsamples
Robust standard errors
Prefix commands

The by: prefix
The nestreg: prefix
The stepwise: prefix
The svy: prefix
The mi estimate: prefix

Setting confidence levels
Postestimation commands
Closing thoughts

 

21. POSTESTIMATION COMMANDS

Chapter overview
The contrast command
The margins command

The at() option
Margins with factor variables
Margins with factor variables and the at() option
The dydx() option

The marginsplot command
The pwcompare command
Closing thoughts

 

22. STATA DATA MANAGEMENT COMMANDS

Chapter overview
Reading data into Stata

Reading Stata datasets
Reading Excel workbooks
Reading comma-separated files
Reading other file formats

Saving data
Labeling data

Variable labels
A looping trick
Value labels

Creating and recoding variables

Creating new variables with generate
Modifying existing variables with replace
Extensions to generate egen
Recode

Keeping and dropping variables
Keeping and dropping observations
Combining datasets

Appending datasets
Merging datasets

Reshaping datasets

Reshaping datasets wide to long
Reshaping datasets long to wide

Closing thoughts

 

23. STATA EQUIVALENTS OF COMMON IBM SPSS COMMANDS

Chapter overview
ADD FILES
AGGREGATE
ANOVA
AUTORECODE
CASESTOVARS
COMPUTE
CORRELATIONS
CROSSTABS
DATA LIST
DELETE VARIABLES
DESCRIPTIVES
DISPLAY
DOCUMENT
FACTOR
FILTER
FORMATS
FREQUENCIES
GET FILE
GET TRANSLATE
LOGISTIC REGRESSION
MATCH FILES
MEANS
MISSING VALUES
MIXED
MULTIPLE IMPUTATION
NOMREG
PLUM
PROBIT
RECODE
RELIABILITY
RENAME VARIABLES
SAVE
SELECT IF
SAVE TRANSLATE
SORT CASES
SORT VARIABLES
SUMMARIZE
T-TEST
VALUE LABELS
VARIABLE LABELS
VARSTOCASES
Closing thoughts

References
Author index
Subject index

Author: Michael N. Mitchell
ISBN978-1-59718-173-0
©Copyright: 2015
Versione e-Book disponibile

Stata for the Behavioral Sciences, by Michael Mitchell, is the ideal reference for researchers using Stata to fit ANOVA models and other models commonly applied to behavioral science data. Drawing on his education in psychology and his experience in consulting, Mitchell uses terminology and examples familiar to the reader as he demonstrates how to fit a variety of models, how to interpret results, how to understand simple and interaction effects, and how to explore results graphically.