Linear Models with R (用R语言处理线性模型)(Texts.in.Statistical.Science)
1 Introduction 1
1.1 Before You Start 1
1.2 Initial Data Analysis 2
1.3 When to Use Regression Analysis 7
1.4 History 7
2 Estimation 12
2.1 Linear Model 12
2.2 Matrix Representation 13
2.3 Estimating ! 13
2.4 Least Squares Estimation 14
2.5 Examples of Calculating 16
2.6 Gauss—Markov Theorem 17
2.7 Goodness of Fit 18
2.8 Example 20
2.9 Identifiability 23
3 Inference 28
3.1 Hypothesis Tests to Compare Models 28
3.2 Testing Examples 30
3.3 Permutation Tests 36
3.4 Confidence Intervals for ! 38
3.5 Confidence Intervals for Predictions 41
3.6 Designed Experiments 44
3.7 Observational Data 48
3.8 Practical Difficulties 53
4 Diagnostics 58
4.1 Checking Error Assumptions 58
4.2 Finding Unusual Observations 69
4.3 Checking the Structure of the Model 78
viii Contents
5 Problems with the Predictors 83
5.1 Errors in the Predictors 83
5.2 Changes of Scale 88
5.3 Collinearity 89
6 Problems with the Error 96
6.1 Generalized Least Squares 96
6.2 Weighted Least Squares 99
6.3 Testing for Lack of Fit 102
6.4 Robust Regression 106
7 Transformation 117
7.1 Transforming the Response 117
7.2 Transforming the Predictors 120
8 Variable Selection 130
8.1 Hierarchical Models 130
8.2 Testing-Based Procedures 131
8.3 Criterion-Based Procedures 134
8.4 Summary 139
9 Shrinkage Methods 142
9.1 Principal Components 142
9.2 Partial Least Squares 150
9.3 Ridge Regression 152
10 Statistical Strategy and Model Uncertainty 157
10.1 Strategy 157
10.2 An Experiment in Model Building 158
10.3 Discussion 159
11 Insurance Redlining—A Complete Example 161
11.1 Ecological Correlation 161
11.2 Initial Data Analysis 163
11.3 Initial Model and Diagnostics 165
11.4 Transformation and Variable Selection 168
11.5 Discussion 171
12 Missing Data 173
Contents ix
13 Analysis of Covariance 177
13.1 A Two-Level Example 178
13.2 Coding Qualitative Predictors 182
13.3 A Multilevel Factor Example 184
14 One-Way Analysis of Variance 191
14.1 The Model 191
14.2 An Example 192
14.3 Diagnostics 195
14.4 Pairwise Comparisons 196
15 Factorial Designs 199
15.1 Two-Way ANOVA 199
15.2 Two-Way ANOVA with One Observation per Cell 200
15.3 Two-Way ANOVA with More than One Observation per Cell 203
15.4 Larger Factorial Experiments 207
16 Block Designs 213
16.1 Randomized Block Design
16.2 Latin Squares 218
16.3 Balanced Incomplete Block Design 222
A R Installation, Functions and Data 227
B Quick Introduction to R 229
B.1 Reading the Data In 229
B.2 Numerical Summaries 229
B.3 Graphical Summaries 230
B.4 Selecting Subsets of the Data 231
B.5 Learning More about R 232
Bibliography 233
Index 237