使用Stata做回归胜在简洁明了。
Table of Contents
Preface v
Chapter 1: Introduction to Stata and Data Analytics 1
Introducing data analytics 2
The Stata interface 4
Data-storing techniques in Stata 6
Directories and folders in Stata 6
Reading data in Stata 7
Insheet 8
Infix 9
The Stat/Transfer program 10
Manual typing or copy and paste 11
Variables and data types 11
Indicators or data variables 12
Examining the data 12
How to subset the data file using IN and IF 13
Summary 16
Chapter 2: Stata Programming and Data Management 17
The labeling of data, variables, and variable transformations 17
Summarizing the data and preparing tabulated reports 20
Appending and merging the files for data management 25
Macros 29
Loops in Stata 32
While loops 35
Summary 3
Chapter 3: Data Visualization 37
Scatter plots 37
Line plots 43
Histograms and other charts 46
Box plots 47
Pie charts 49
Pyramidal graphs 50
Vio plots 51
Ci plots 52
Statistical calculations in graphs 53
Curve fitting in Stata 60
Summary 61
Chapter 4: Important Statistical Tests in Stata 63
T tests 63
Two independent sample t tests 64
The chi-square goodness of fit test 65
ANOVA 66
One-way repeated ANOVA measures 68
MANOVA 69
Fisher's exact test 71
The Wilcoxon-Mann-Whitney test 72
Summary 74
Chapter 5: Linear Regression in Stata 75
Linear regression 75
Linear regression code in Stata 78
Variance inflation factor and multicollinearity 85
Homoscedasticity 86
Summary 88
Chapter 6: Logistic Regression in Stata 89
The logistic regression concept 89
Logit 90
Logistic regression in Stata 94
Logistic regression for finance (loans and credit cards) 106
Summary
Chapter 7: Survey Analysis in Stata 107
Survey analysis concepts 107
Survey analysis in Stata code 112
Cluster sampling 119
Summary 121
Chapter 8: Time Series Analysis in Stata 123
Time series analysis concepts 123
Code for time series analysis in Stata 129
Summary 134
Chapter 9: Survival Analysis in Stata 135
Survival analysis concepts 136
Applications and code in Stata for survival analysis 138
Building a model 140
Proportionality assumption 142
Summary 149
Index 15