An R and S-Plus Companion to Applied RegressionSAGE, 2002/06/05 - 312 ページ "This book fits right into a needed niche: rigorous enough to give full explanation of the power of the S language, yet accessible enough to assign to social science graduate students without fear of intimidation. It is a tremendous balance of applied statistical "firepower" and thoughtful explanation. It meets all of the important mechanical needs: each example is given in detail, code and data are freely available, and the nuances of models are given rather than just the bare essentials. It also meets some important theoretical needs: linear models, categorical data analysis, an introduction to applying GLMs, a discussion of model diagnostics, and useful instructions on writing customized functions. " —JEFF GILL, University of Florida, Gainesville |
目次
Introducing R and SPLUS | 1 |
111 Interacting with the Interpreter | 2 |
112 S Functions | 4 |
113 Vectors and Variables | 7 |
114 UserDefined Functions | 12 |
115 Cleaning Up | 14 |
116 Command Editing and Output Management | 15 |
117 When Things Go Wrong | 16 |
47 More on 1m and Model Formulas | 149 |
472 data | 150 |
473 subset | 151 |
476 method model x y qr | 152 |
479 offset R only | 153 |
Fitting Generalized Linear Models | 155 |
52 Models for Categorial Responses | 158 |
522 Polytomous Data | 167 |
Duncans OccupationalPrestige Regression | 18 |
121 Reading the Data | 19 |
122 Examining the Data | 21 |
123 Regression Analysis | 26 |
124 Regression Diagnostics | 28 |
13 S Functions for Basic Statistics | 34 |
Reading and Manipulating Data | 37 |
21 Data Input | 38 |
212 File Input to a Data Frame | 42 |
213 Importing Data | 46 |
214 Accessing Data in S Libraries | 47 |
215 Getting Data Out of S | 48 |
22 Working with Data Frames | 49 |
222 Missing Data | 54 |
223 Numeric Variables and Factors | 60 |
224 Modifying Data | 62 |
23 Matrices Arrays and Lists | 68 |
231 Matrices | 69 |
232 Arrays | 70 |
234 Indexing | 71 |
24 Data Attributes Models and Classes | 78 |
241 Data in S4 | 82 |
Exploring and Transforming Data | 85 |
31 Examining Distributions | 86 |
312 Density Estimates | 88 |
313 QuantileComparison Plots | 90 |
314 Boxplots | 91 |
32 Examining Relationships | 93 |
322 Bivariate Density Estimates | 98 |
323 Parallel Boxplots | 100 |
33 Examining Multivariate Data | 102 |
332 Conditioning Plots | 105 |
34 Transforming Data | 106 |
341 Transformations for Normality and Symmetry | 109 |
342 Transformations to Equalize Spread | 113 |
343 Transformations to Linearity | 115 |
Fitting Linear Models | 119 |
412 Multiple Regression | 123 |
413 Standardized Regression Coefficients | 124 |
42 DummyVariable Regression | 126 |
422 Contrasts | 127 |
423 Ordered Factors | 130 |
425 Dummy Regression with Interactions | 133 |
43 Analysis of Variance Models | 136 |
44 Fitting Additive DummyRegression Models | 142 |
45 General Linear Hypotheses | 145 |
46 Data and Confidence Ellipses | 147 |
53 Poisson Generalized Linear Models for Count Data | 177 |
531 Poisson Regression | 178 |
532 LogLinear Models for Contingency Tables | 181 |
54 Odds and Ends | 185 |
542 Arguments to g1m | 188 |
55 Fitting Generalized Linear Models by Iterated Weighted Least Squares | 189 |
Diagnosing Problems in Linear and Generalized Linear Models | 191 |
61 Unusual Data | 192 |
Hat Values | 194 |
613 Influence Measures | 195 |
62 Nonnormal Errors | 201 |
621 BoxCox Transformation of y | 203 |
622 ConstructedVariable Plot for the BoxCox Transformation | 204 |
63 Nonconstant Error Variance | 206 |
631 Score Tests for Nonconstant Error Variance | 208 |
64 Nonlinearity | 210 |
642 BoxTidwell Transformations of the Predictors | 214 |
643 ConstructedVariable Plots for BoxTidwell Transformations | 215 |
65 Collinearity and Variable Selection | 216 |
652 Variable Selection | 220 |
66 Diagnostics for Generalized Linear Models | 225 |
662 Nonlinearity Diagnostics | 230 |
Drawing Graphs | 235 |
71 A General Approach to S Graphics | 236 |
axis points lines text and so on | 239 |
713 Specifying Colors | 246 |
Effect Displays | 247 |
73 Graphics Devices | 255 |
Writing Programs | 257 |
81 Defining Functions | 258 |
82 Working with Matrices | 261 |
Conditionals Loops and Recursion | 268 |
832 Loops Iteration | 269 |
833 Recursion | 272 |
Binary Logistic Regression | 273 |
84 apply and its Relatives | 278 |
85 ObjectOriented Programming in S | 283 |
852 S Version 4 | 288 |
86 Writing S Programs | 292 |
295 | |
299 | |
300 | |
305 | |
306 | |
About the Author | |