Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover Page
Dedication
Title Page
Copyright
Contents
Preface
1. Getting Started With R
1.1 R Basics
1.1.1 Interacting With the Interpreter
1.1.2 R Functions
1.1.3 Vectors and Variables
1.1.4 Nonnumeric Vectors
1.1.5 Indexing Vectors
1.1.6 User-Defined Functions
1.1.7 Command Editing and Output Management
1.1.8 When Things Go Wrong
1.1.9 Getting Help and Information
1.1.10 Cleaning Up
1.1.11 Ending the R Session
1.2 An Extended Illustration: Duncan’s Occupational-Prestige Regression
1.2.1 Reading the Data
1.2.2 Examining the Data
1.2.3 Regression Analysis
1.2.4 Regression Diagnostics
1.3 R Functions for Basic Statistics
1.4 Generic Functions and Their Methods*
1.5 The R Commander Graphical User Interface
2. Reading and Manipulating Data
2.1 Data Input
2.1.1 Keyboard Input
2.1.2 File Input to a Data Frame
2.1.3 Importing Data
2.1.4 Accessing Data in R Packages
2.1.5 Getting Data Out of R
2.2 Working With Data Frames
2.2.1 The Search Path
2.2.2 Avoiding attach
2.2.3 Missing Data
2.2.4 Numeric Variables and Factors
2.2.5 Modifying and Transforming Data
2.3 Matrices, Arrays, and Lists
2.3.1 Matrices
2.3.2 Arrays
2.3.3 Lists
2.3.4 Indexing
2.4 Manipulating Character Data
2.5 Handling Large Data Sets in R*
2.5.1 How Large is “Large”?
2.5.2 Speeding Up read.table
2.5.3 Accessing Data in Databases
2.6 More on the Representation of Data in R*
2.6.1 Length, Class, Mode, and Attributes
2.6.2 Pitfalls of Floating-Point Arithmetic
2.7 Complementary Reading and References
3. Exploring and Transforming Data
3.1 Examining Distributions
3.1.1 Histograms
3.1.2 Density Estimation
3.1.3 Quantile-Comparison Plots
3.1.4 Boxplots
3.2 Examining Relationships
3.2.1 Scatterplots
3.2.2 Parallel Boxplots
3.2.3 More on plot
3.3 Examining Multivariate Data
3.3.1 Three-Dimensional Plots
3.3.2 Scatterplot Matrices
3.4 Transforming Data
3.4.1 Logarithms
3.4.2 Power Transformations
3.4.3 Transforming Restricted-Range Variables
3.4.4 Other Transformations
3.4.5 Transformations to Equalize Spread
3.4.6 Transformations Toward Linearity
3.4.7 Families of Transformations*
3.5 Point Labeling and Identification
3.5.1 The identify Function
3.5.2 Automatic Labeling of Points
3.6 Complementary Reading and References
4. Fitting Linear Models
4.1 Introduction
4.2 Linear Least-Squares Regression
4.2.1 Simple Regression
4.2.2 Multiple Regression
4.2.3 Models with Factors and Interactions
4.3 Working With Coefficients
4.3.1 Confidence Intervals
4.3.2 Estimated Coefficients
4.3.3 Effect Displays for Linear Models
4.3.4 Coefficient Standard Errors*
4.3.5 Standardized Regression Coefficients
4.3.6 Sandwich Estimates of Coefficient Standard Errors*
4.3.7 Bootstrapping Regression Models
4.3.8 Confidence Ellipses and Data Ellipses*
4.4 Testing Hypotheses About Regression Coefficients
4.4.1 Wald Tests
4.4.2 Likelihood Ratio Tests and the Analysis of Variance
4.4.3 Sequential Analysis of Variance
4.4.4 The Anova Function
4.4.5 Testing General Linear Hypotheses*
4.4.6 Nonlinear Functions of Coefficients*
4.4.7 Testing Regression Models Using Simulation*
4.5 Model Selection
4.6 More on Factors
4.6.1 Coding Factors
4.6.2 Other Factor Codings
4.6.3 Ordered Factors and Orthogonal Polynomials
4.6.4 User-Specified Contrasts*
4.7 Overparametrized Models*
4.7.1 No Intercept
4.7.2 Singularity
4.8 The Arguments of the lm Function
4.8.1 formula
4.8.2 data
4.8.3 subset
4.8.4 weights
4.8.5 na.action
4.8.6 method, model, x, y, qr*
4.8.7 singular.ok*
4.8.8 contrasts
4.8.9 offset
4.9 Using lm Objects
4.10 Complementary Reading and References
5. Fitting Generalized Linear Models
5.1 The Structure of GLMs
5.2 The glm Function in R
5.3 GLMs for Binary-Response Data
5.3.1 Fitting the Binary Logistic-Regression Model
5.3.2 Parameter Estimates for Logistic Regression
5.3.3 Analysis of Deviance for Logistic Regression
5.3.4 Fitted Values
5.4 Binomial Data
5.5 Poisson GLMs for Count Data
5.6 Loglinear Models for Contingency Tables
5.6.1 Two-Dimensional Tables
5.6.2 Three-Dimensional Contingency Tables
5.6.3 Sampling Plans for Loglinear Models
5.6.4 Response Variables
5.6.5 Preparing Data for Fitting a Loglinear Model
5.7 Multinomial Response Data
5.8 Nested Dichotomies
5.9 Proportional-Odds Model
5.10 Extensions
5.10.1 More on the Anova Function
5.10.2 Gamma Models
5.10.3 Quasi-Likelihood Estimation
5.10.4 Overdispersed Binomial and Poisson Models
5.10.5 “Rolling Your Own” GLM*
5.11 Arguments to glm
5.11.1 weights
5.11.2 start
5.11.3 offset
5.11.4 control
5.11.5 model, method, x, y
5.12 Fitting GLMs by Iterated Weighted Least Squares*
5.13 Complementary Reading and References
6. Diagnosing Problems in Linear and Generalized Linear Models
6.1 Residuals
6.2 Basic Diagnostic Plots
6.2.1 Plotting Residuals
6.2.2 Marginal Model Plots
6.2.3 Added-Variable Plots
6.3 Unusual Data
6.3.1 Outliers and Studentized Residuals
6.3.2 Leverage: Hat-Values
6.3.3 Influence Measures
6.4 Transformations After Fitting a Regression Model
6.4.1 Transforming the Response
6.4.2 Predictor Transformations
6.5 Nonconstant Error Variance
6.5.1 Spread-Level Plots
6.5.2 Score Tests for Nonconstant Error Variance
6.5.3 Other Approaches to Nonconstant Error Variance
6.6 Diagnostics for Generalized Linear Models
6.6.1 Residuals and Residual Plots
6.6.2 Influence Measures
6.6.3 Graphical Methods: Added-Variable and Component-Plus-Residual Plots
6.7 Collinearity and Variance Inflation Factors
6.8 Complementary Reading and References
7. Drawing Graphs
7.1 A General Approach to R Graphics
7.1.1 Defining a Coordinate System: plot
7.1.2 Graphics Parameters: par
7.1.3 Adding Graphical Elements: axis, points, lines, text, etcetera
7.1.4 Specifying Colors
7.2 Putting It Together: Explaining Nearest-Neighbor Kernel Regression
7.2.1 Finer Control Over Plot Layout
7.3 Lattice and Other Graphics Packages in R
7.3.1 The Lattice Package
7.3.2 Maps
7.3.3 Other Notable Graphics Packages
7.4 Graphics Devices
7.5 Complementary Reading and References
8. Writing Programs
8.1 Defining Functions
8.2 Working With Matrices*
8.2.1 Basic Matrix Arithmetic
8.2.2 Matrix Inversion and the Solution of Linear Simultaneous Equations
8.2.3 Example: Linear Least-Squares Regression
8.2.4 Eigenvalues and Eigenvectors
8.2.5 Miscellaneous Matrix Computations
8.3 Program Control: Conditionals, Loops, and Recursion
8.3.1 Conditionals
8.3.2 Iteration (Loops)
8.3.3 Recursion
8.4 apply and Its Relatives
8.4.1 To Loop or Not To Loop?
8.5 Illustrative R Programs*
8.5.1 Binary Logistic Regression
8.5.2 Numbers Into Words
8.6 Improving R Programs*
8.6.1 Debugging R Code
8.6.2 Profiling R Functions
8.7 Object-Oriented Programming in R*
8.7.1 The S3 Object System
8.7.2 The S4 Object System
8.8 Writing Statistical-Modeling Functions in R*
8.9 Environments and Scope in R*
8.9.1 Basic Definitions: Frames, Environments, and Scope
8.9.2 Lexical Scoping in R
8.10 R Programming Advice
8.11 Complementary Reading and References
References
Author Index
Subject Index
Command Index
Data Set Index
Package Index
About the Authors
← Prev
Back
Next →
← Prev
Back
Next →