Preface
Acknowledgments
Authors
1 Basic Commands
1.1 Introduction
1.2 Entering Stata
1.3 Taskbar
1.4 Help
1.5 Stata Working Directories
1.6 Reading a Data File
1.7 insheet Procedure
1.8 Types of Files
1.9 Data Editor
2 Data Description
2.1 Most Useful Commands
2.2 list Command
2.3 Mathematical and Logical Operators
2.4 generate Command
2.5 recode Command
2.6 drop Command
2.7 replace Command
2.8 label Command
2.9 summarize Command
2.10 do-file Editor
2.11 Descriptive Statistics and Graphs
2.12 tabulate Command
3 Graph Construction
3.1 Introduction
3.2 Box Plot
3.3 Histogram
3.4 Bar Chart
4 Significance Tests
4.1 Introduction
4.2 Normality Test
4.3 Variance Homogeneity
4.4 Student's t-Test for Independent Samples
4.5 Confidence Intervals for Testing the Null Hypothesis
4.6 Nonparametric Tests for Unpaired Groups
4.7 Sample Size and Statistical Power
5 Linear Regression Models
5.1 Introduction
5.2 Model Assumptions
5.3 Parameter Estimation
5.4 Hypothesis Testing
5.5 Coefficient of Determination
5.6 Pearson Correlation Coefficient
5.7 Scatter Plot
5.8 Running the Model
5.9 Centering
5.10 Bootstrapping
5.11 Multiple Linear Regression Model
5.12 Partial Hypothesis
5.13 Prediction
5.14 Polynomial Linear Regression Model
5.15 Sample Size and Statistical Power
5.16 Considerations for the Assumptions of the Linear Regression Model
6 Analysis of Variance
6.1 Introduction
6.2 Data Structure
6.3 Example for Fixed Effects
6.4 Linear Model with Fixed Effects
6.5 Analysis of Variance with Fixed Effects
6.6 Programming for ANOVA
6.7 Planned Comparisons (before Observing the Data)
6.7.1 Comparison of Two Expected Values
6.7.2 Linear Contrast
6.8 Multiple Comparisons: Unplanned Comparisons
6.9 Random Effects
6.10 Other Measures Related to the Random Effects Model
6.10.1 Covariance
6.10.2 Variance and Its Components
6.10.3 Intraclass Correlation Coefficient
6.11 Example of a Random Effects Model
6.12 Sample Size and Statistical Power
7 Categorical Data Analysis
7.1 Introduction
7.2 Cohort Study
7.3 Case-Control Study
7.4 Sample Size and Statistical Power
8 Logistic Regression Model
8.1 Model Definition
8.2 Parameter Estimation
8.3 Programming the Logistic Regression Model
8.3.1 Using glm
8.3.2 Using logit
8.3.3 Using logistic
8.3.4 Using binreg
8.4 Alternative Database
8.5 Estimating the Odds Ratio
8.6 Significance Tests
8.6.1 Liklihood Ratio Test
8.6.2 Wald Test
8.7 Extension of the Logistic Regression Model
8.8 Adjusted OR and the Confounding Effect
8.9 Effect Modification
8.10 Prevalence Ratio
8.11 Nominal and Ordinal Outcomes
8.12 Overdispersion
8.13 Sample Size and Statistical Power
9 Poisson Regression Model
9.1 Model Definition
9.2 Relative Risk
9.3 Parameter Estimation
9.4 Example
9.5 Programming the Poisson Regression Model
9.6 Assessing Interaction Terms
9.7 Overdispersion
10 Survival Analysis
10.1 Introduction
10.2 Probability of Survival
10.3 Components of the Study Design
10.4 Kaplan–Meier Method
10.5 Programming of
S(t)
10.6 Hazard Function
10.7 Relationship between
S(t) and
h(t)
10.8 Cumulative Hazard Function
10.9 Median Survival Time and Percentiles
10.10 Comparison of Survival Curves
10.11 Proportional Hazards Assumption
10.12 Significance Assessment
10.12.1 Log-Rank Test
10.12.2 Wilcoxon–Gehan–Breslow Test
10.12.3 Tarone–Ware Test
10.13 Cox Proportional Hazards Model
10.14 Assessment of the Proportional Hazards Assumption
10.15 Survival Function Estimation Using the Cox Proportional Hazards Model
10.16 Stratified Cox Proportional Hazards Model
11 Analysis of Correlated Data
11.1 Regression Models with Correlated Data
11.2 Mixed Models
11.3 Random Intercept
11.4 Using the mixed and gllamm Commands with a Random Intercept
11.5 Using the mixed Command with Random Intercept and Slope
11.6 Mixed Models in a Sampling Design
12 Introduction to Advanced Programming in Stata
12.1 Introduction
12.2 do-files
12.3 program Command
12.4 Log Files
12.5 trace Command
12.6 Delimiters
12.7 Indexing
12.8 Local Macros
12.9 Scalars
12.10 Loops (foreach and forvalues)
12.11 Application of matrix and local Commands for Prevalence Estimation
References
Index