An Introduction to Stata for Health Researchers

Svend Juul and Morten Frydenberg’s An Introduction to Stata for Health Researchers, Fourth Edition is distinguished in its careful attention to detail. The reader will learn not only the skills for statistical analysis but also the skills to make the analysis reproducible. The authors use a friendly, down-to-earth tone and include tips gained from a lifetime of collaboration and consulting.

 

The book is based on the assumption that the reader has some basic knowledge of statistics but no knowledge of Stata. The authors build the reader’s abilities as a builder would build a house: laying a firm foundation in Stata, framing a general structure in which good work can be accomplished, adding the details that are particular to various types of statistical analyses, and, finally, trimming with a thorough treatment of graphics and special topics such as power and sample-size computations.

 

Juul and Frydenberg start not only by teaching the reader how to communicate with Stata through its unified syntax but also by demonstrating how Stata thinks about its basic building blocks. The authors show how Stata views data, thus allowing the reader to see the variety of possible data structures. They also show how to manipulate data to create a dataset that is well documented. When demonstrating analysis techniques, the authors show how to think of analysis in terms of estimation and postestimation. They make the book easy to use as a learning tool and easy to refer back to for useful techniques.

 

Once they introduce Stata to new users, Juul and Frydenberg fill in the details for performing analysis in Stata. As would be expected from a book addressing health researchers, the authors mostly demonstrate the statistical techniques that are common in biostatistics and epidemiology: case–control, matched case–control, and incidence-rate data analysis; linear and generalized linear models, including logistic, Poisson, and binomial regression; survival analysis with proportional hazards; and classification using receiver operating characteristic curves. While presenting general estimation techniques, the authors also spend time with interactions and techniques for checking model assumptions.

 

While teaching Stata implementation, Juul and Frydenberg reinforce habits that allow reproducible research and graceful backtracking in case of errors. Early in the book, they introduce how to use do-files for creating sequences and log files for tracking work. At the end of the book, they introduce some useful programming techniques, such as loops and branching, that simplify repetitive tasks.

 

The fourth edition has been substantially revised based on new features in Stata 12 and Stata 13. The updated material has been streamlined while including new features in Stata.

List of tables
List of figures
Preface to the fourth edition
Preface to the first edition
Online supplements
Notations in this book

 

I THE BASICS 

 

1. GETTING STARTED

Installing and updating Stata
Starting and exiting Stata
Windows in Stata
Issuing commands
Managing output

 

2. GETTING HELP-AND MORE

The help and search commands
The PDF documentation
Other resources

 

3. STATA FILE TYPES AND NAMES

 

4. COMMAND SYNTAX

General syntax rules
Syntax diagrams
Lists of variables and numbers
Qualifiers
Weights
Options
Prefixes
Other syntax elements
Version control
Errors and error messages

 

II DATA MANAGEMENT

 

5. VARIABLES

Numeric formats
Missing values
Storage types and precision
Date and time variables
String variables
Memory considerations

 

6. GETTING DATA IN AND OUT OF STATA

Opening and saving Stata data
Entering data
Exchanging data with other programs

 

7. DOCUMENTATION COMMANDS

Labels

 

8. CALCULATIONS

Generate and replace
Operators and functions in calculations
The egen command
Recoding variables
Checking correctness of calculations
Giving numbers to observations

 

9. COMMANDS AFFECTING DATA STRUCTURE

Selecting observations and variables
Renaming and reordering variables
Sorting data
Combining files
Reshaping data

 

10. TAKING GOOD CARE OF YOUR DATA

The audit trail
Collecting and entering data
Data management
Analysis
Protect your data
Archiving the project

 

III ANALYSIS

 

11. DESCRIPTION AND SIMPLE ANALYSIS

Overview of a dataset
Listing observations
Simple tables for categorical variables
Epidemiologic tables
Analyzing continuous variables
Finding confidence intervals
Immediate commands

 

12. REGRESSION ANALYSIS

Linear regression
Regression postestimation
Categorical predictors—factor variables
Interactions in regression models
Logistic regression
Other regression models
Nonindependent observations

 

13. TIME-TO-EVENT DATA

Setting the time scale and event: The stset command
The Kaplan–Meier survival function
Tabulating rates
Cox proportional hazards regression
Preparing data for advanced survival analyses
Advanced survival modeling
Poisson regression
Standardization

 

14. MEASUREMENT AND DIAGNOSIS

Comparing two measurements
Reproducibility of measurements
Using tests for diagnosis

 

15. MISCELLNEOUS

Random samples, simulations
Power and sample-size analysis
Commands that influence program flow
Decimal periods and commas
Logging output permanently
Other analyses

 

IV GRAPHS

 

16. GRAPHS

Anatomy of a graph
Anatomy of graph commands
Graph size
Schemes
Graph options: Axes
Graph options: Text elements
Plot options: Markers, lines, etc.
Histograms and other distribution graphs
Twoway plots: scatterplots and line plots
Bar graphs
By-graphs and combined graphs
Saving and exporting graphs

 

V Advanced topics

 

17. ADVANCED TOPICS

Using stored results
Macros and scalars
Some useful commands
Programs
Debugging programs

 

VI APPENDIXES

 

A. STATA MANUALS

 

B. EXERCISES

The user interface
Managing output
Calculations
Working with missing values
Working with date variables
Description and simple analysis
Taking good care of your data

 

C. SHORTCUTS AND KEYSTROKES

Author: Svend Juul and Morten Frydenberg
Edition: Fourth Edition
ISBN-13: 978-1-59718-135-8
©Copyright: 2014
Versione e-Book disponibile

The book is based on the assumption that the reader has some basic knowledge of statistics but no knowledge of Stata. The authors build the reader’s abilities as a builder would build a house: laying a firm foundation in Stata, framing a general structure in which good work can be accomplished, adding the details that are particular to various types of statistical analyses, and, finally, trimming with a thorough treatment of graphics and special topics such as power and sample-size computations.