## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

## Book Description

Discover what you can do with R! Introducing the R system, covering standard regression methods, then tackling more advanced topics, this book guides users through the practical, powerful tools that the R system provides. The emphasis is on hands-on analysis, graphical display, and interpretation of data. The many worked examples, from real-world research, are accompanied by commentary on what is done and why. The companion website has code and datasets, allowing readers to reproduce all analyses, along with solutions to selected exercises and updates. Assuming basic statistical knowledge and some experience with data analysis (but not R), the book is ideal for research scientists, final-year undergraduate or graduate-level students of applied statistics, and practising statisticians. It is both for learning and for reference. This third edition expands upon topics such as Bayesian inference for regression, errors in variables, generalized linear mixed models, and random forests.

1. Cover
2. Half Title
3. Title Page
5. Contents
6. Preface
7. Content – how the chapters fit together
8. 1. A brief introduction to R
1. 1.1 An overview of R
2. 1.2 Vectors, factors, and univariate time series
3. 1.3 Data frames and matrices
4. 1.4 Functions, operators, and loops
5. 1.5 Graphics in R
6. 1.6 Additional points on the use of R
7. 1.7 Recap
8. 1.8 Further reading
9. 1.9 Exercises
9. 2. Styles of data analysis
1. 2.1 Revealing views of the data
2. 2.2 Data summary
3. 2.3 Statistical analysis questions, aims, and strategies
4. 2.4 Recap
5. 2.5 Further reading
6. 2.6 Exercises
10. 3. Statistical models
1. 3.1 Statistical models
2. 3.2 Distributions: models for the random component
3. 3.3 Simulation of random numbers and random samples
4. 3.4 Model assumptions
5. 3.5 Recap
6. 3.6 Further reading
7. 3.7 Exercises
11. 4. A review of inference concepts
1. 4.1 Basic concepts of estimation
2. 4.2 Confidence intervals and tests of hypotheses
3. 4.3 Contingency tables
4. 4.4 One-way unstructured comparisons
5. 4.5 Response curves
6. 4.6 Data with a nested variation structure
7. 4.7 Resampling methods for standard errors, tests, and confidence intervals
8. 4.8* Theories of inference
9. 4.9 Recap
10. 4.10 Further reading
11. 4.11 Exercises
12. 5. Regression with a single predictor
1. 5.1 Fitting a line to data
2. 5.2 Outliers, influence, and robust regression
3. 5.3 Standard errors and confidence intervals
4. 5.4 Assessing predictive accuracy
5. 5.5 Regression versus qualitative anova comparisons – issues of power
6. 5.6 Logarithmic and other transformations
7. 5.7 There are two regression lines!
8. 5.8 The model matrix in regression
9. 5.9* Bayesian regression estimation using the MCMCpack package
10. 5.10 Recap
11. 5.11 Methodological references
12. 5.12 Exercises
13. 6. Multiple linear regression
1. 6.1 Basic ideas: a book weight example
2. 6.2 The interpretation of model coefficients
3. 6.3 Multiple regression assumptions, diagnostics, and efficacy measures
4. 6.4 A strategy for fitting multiple regression models
5. 6.5 Problems with many explanatory variables
6. 6.6 Multicollinearity
7. 6.7 Errors in x
8. 6.8 Multiple regression models – additional points
9. 6.9 Recap
10. 6.10 Further reading
11. 6.11 Exercises
14. 7. Exploiting the linear model framework
1. 7.1 Levels of a factor – using indicator variables
2. 7.2 Block designs and balanced incomplete block designs
3. 7.3 Fitting multiple lines
4. 7.4 Polynomial regression
5. 7.5* Methods for passing smooth curves through data
6. 7.6 Smoothing with multiple explanatory variables
7. 7.7 Further reading
8. 7.8 Exercises
15. 8. Generalized linear models and survival analysis
1. 8.1 Generalized linear models
2. 8.2 Logistic multiple regression
3. 8.3 Logistic models for categorical data – an example
4. 8.4 Poisson and quasi-Poisson regression
5. 8.5 Additional notes on generalized linear models
6. 8.6 Models with an ordered categorical or categorical response
7. 8.7 Survival analysis
8. 8.8 Transformations for count data
9. 8.9 Further reading
10. 8.10 Exercises
16. 9. Time series models
1. 9.1 Time series – some basic ideas
2. 9.2* Regression modeling with ARIMA errors
3. 9.3* Non-linear time series
4. 9.4 Further reading
5. 9.5 Exercises
17. 10. Multi-level models and repeated measures
1. 10.1 A one-way random effects model
2. 10.2 Survey data, with clustering
3. 10.3 A multi-level experimental design
4. 10.4 Within- and between-subject effects
5. 10.5 A generalized linear mixed model
6. 10.6 Repeated measures in time
7. 10.7 Further notes on multi-level and other models with correlated errors
8. 10.8 Recap
9. 10.9 Further reading
10. 10.10 Exercises
18. 11. Tree-based classification and regression
1. 11.1 The uses of tree-based methods
2. 11.2 Detecting email spam – an example
3. 11.3 Terminology and methodology
4. 11.4 Predictive accuracy and the cost–complexity trade-off
5. 11.5 Data for female heart attack patients
6. 11.6 Detecting email spam – the optimal tree
7. 11.7 The randomForest package
8. 11.8 Additional notes on tree-based methods
9. 11.9 Further reading and extensions
10. 11.10 Exercises
19. 12. Multivariate data exploration and discrimination
1. 12.1 Multivariate exploratory data analysis
2. 12.2 Discriminant analysis
3. 12.3* High-dimensional data, classification, and plots
4. 12.4 Further reading
5. 12.5 Exercises
20. 13. Regression on principal component or discriminant scores
1. 13.1 Principal component scores in regression
2. 13.2* Propensity scores in regression comparisons – labor training data
3. 13.3 Further reading
4. 13.4 Exercises
21. 14. The R system – additional topics
1. 14.1 Graphical user interfaces to R
2. 14.2 Working directories, workspaces, and the search list
3. 14.3 R system configuration
4. 14.4 Data input and output
5. 14.5 Functions and operators – some further details
6. 14.6 Factors
7. 14.7 Missing values
8. 14.8* Matrices and arrays
9. 14.9 Manipulations with lists, data frames, matrices, and time series
10. 14.10 Classes and methods
11. 14.11 Manipulation of language constructs
12. 14.12* Creation of R packages
13. 14.13 Document preparation – Sweave() and xtable()
14. 14.14 Further reading
15. 14.15 Exercises
22. 15. Graphs in R
1. 15.1 Hardcopy graphics devices
2. 15.2 Plotting characters, symbols, line types, and colors
3. 15.3 Formatting and plotting of text and equations
4. 15.4 Multiple graphs on a single graphics page
5. 15.5 Lattice graphics and the grid package
6. 15.6 An implementation of Wilkinson’s Grammar of Graphics
7. 15.7 Dynamic graphics – the rgl and rggobi packages
8. 15.8 Further reading
23. Epilogue
24. References
25. Index of R symbols and functions
26. Index of terms
27. Index of authors
28. Plates