**Part I Getting started:**

*1 Introduction to R :*

1.1 Why use R?

1.2 Obtaining and installing R

1.3 Working with R

Getting started ¦ Getting help ¦ The workspace

Input and output

1.4 Packages

What are packages? ¦ Installing a package

Loading a package ¦ Learning about a package

1.5 Batch processing

1.6 Using output as input—reusing results

1.7 Working with large datasets

1.8 Working through an example

1.9 Summary

*2 Creating a dataset :*

2.1 Understanding datasets

2.2 Data structures

Vectors ¦ Matrices ¦ Arrays ¦ Data frames

Factors ¦ Lists

2.3 Data input

Entering data from the keyboard ¦ Importing data from a delimited text

file ¦ Importing data from Excel ¦ Importing data from XML

Webscraping ¦ Importing data from SPSS ¦ Importing data from SAS

Importing data from Stata ¦ Importing data from netCDF

Importing data from HDF5 ¦ Accessing database management systems

(DBMSs) ¦ Importing data via Stat/Transfer

2.4 Annotating datasets

Variable labels ¦ Value labels

2.5 Useful functions for working with data objects

2.6 Summary

*3 Getting started with graphs :*

3.1 Working with graphs

3.2 A simple example

3.3 Graphical parameters

Symbols and lines ¦ Colors ¦ Text characteristics

Graph and margin dimensions

3.4 Adding text, customized axes, and legends

Titles ¦ Axes ¦ Reference lines ¦ Legend

Text annotations

3.5 Combining graphs

Creating a figure arrangement with fine control

3.6 Summary

*4 Basic data management :*

4.1 A working example

4.2 Creating new variables

4.3 Recoding variables

4.4 Renaming variables

4.5 Missing values

Recoding values to missing ¦ Excluding missing values from analyses

4.6 Date values

Converting dates to character variables ¦ Going further

4.7 Type conversions

4.8 Sorting data

4.9 Merging datasets

Adding columns ¦ Adding rows

4.10 Subsetting datasets

Selecting (keeping) variables ¦ Excluding (dropping) variables

Selecting observations ¦ The subset() function ¦ Random samples

4.11 Using SQL statements to manipulate data frames

4.12 Summary

*5 Advanced data management:*

5.1 A data management challenge

5.2 Numerical and character functions

Mathematical functions ¦ Statistical functions ¦ Probability functions

Character functions ¦ Other useful functions ¦ Applying functions to

matrices and data frames

5.3 A solution for our data management challenge

5.4 Control flow

Repetition and looping ¦ Conditional execution

5.5 User-written functions

5.6 Aggregation and restructuring

Transpose ¦ Aggregating data ¦ The reshape package

5.7 Summary

**Part II Basic methods:**

*6 Basic graphs:*

6.1 Bar plots

Simple bar plots ¦ Stacked and grouped bar plots ¦ Mean bar plots

Tweaking bar plots ¦ Spinograms

6.2 Pie charts

6.3 Histograms

6.4 Kernel density plots

6.5 Box plots

Using parallel box plots to compare groups ¦ Violin plots

6.6 Dot plots

6.7 Summary

*7 Basic statistics:*

7.1 Descriptive statistics

A menagerie of methods ¦ Descriptive statistics by group

Visualizing results

7.2 Frequency and contingency tables

Generating frequency tables ¦ Tests of independence

Measures of association ¦ Visualizing results

Converting tables to flat files

7.3 Correlations

Types of correlations ¦ Testing correlations for significance

Visualizing correlations

7.4 t-tests

Independent t-test ¦ Dependent t-test ¦ When there are more than two

groups

7.5 Nonparametric tests of group differences

Comparing two groups ¦ Comparing more than two groups

7.6 Visualizing group differences

7.7 Summary

**Part III Intermediate methods:**

*8 Regression:*

8.1 The many faces of regression

Scenarios for using OLS regression ¦ What you need to know

8.2 OLS regression

Fitting regression models with lm() ¦ Simple linear regression

Polynomial regression ¦ Multiple linear regression

Multiple linear regression with interactions

8.3 Regression diagnostics

A typical approach ¦ An enhanced approach ¦ Global validation of

linear model assumption ¦ Multicollinearity

8.4 Unusual observations

Outliers ¦ High leverage points ¦ Influential observations

8.5 Corrective measures

Deleting observations ¦ Transforming variables ¦ Adding or deleting

variables ¦ Trying a different approach

8.6 Selecting the “best” regression model

Comparing models ¦ Variable selection

8.7 Taking the analysis further

Cross-validation ¦ Relative importance

8.8 Summary

*9 Analysis of variance:*

9.1 A crash course on terminology

9.2 Fitting ANOVA models

The aov() function ¦ The order of formula terms

9.3 One-way ANOVA

Multiple comparisons ¦ Assessing test assumptions

9.4 One-way ANCOVA

Assessing test assumptions ¦ Visualizing the results

9.5 Two-way factorial ANOVA

9.6 Repeated measures ANOVA

9.7 Multivariate analysis of variance (MANOVA)

Assessing test assumptions ¦ Robust MANOVA

9.8 ANOVA as regression

9.9 Summary

*10 Power analysis:*

10.1 A quick review of hypothesis testing

10.2 Implementing power analysis with the pwr package

t-tests ¦ ANOVA ¦ Correlations ¦ Linear models

Tests of proportions ¦ Chi-square tests ¦ Choosing an appropriate effect

size in novel situations

10.3 Creating power analysis plots

10.4 Other packages

10.5 Summary

*11 Intermediate graphs :*

11.1 Scatter plots

Scatter plot matrices ¦ High-density scatter plots ¦ 3D scatter plots

Bubble plots

11.2 Line charts

11.3 Correlograms

11.4 Mosaic plots

11.5 Summary

*12 Resampling statistics and bootstrapping*

12.1 Permutation tests

12.2 Permutation test with the coin package

Independent two-sample and k-sample tests ¦ Independence in contingency

tables ¦ Independence between numeric variables

Dependent two-sample and k-sample tests ¦ Going further

12.3 Permutation tests with the lmPerm package

Simple and polynomial regression ¦ Multiple regression

One-way ANOVA and ANCOVA ¦ Two-way ANOVA

12.4 Additional comments on permutation tests

12.5 Bootstrapping

12.6 Bootstrapping with the boot package

Bootstrapping a single statistic ¦ Bootstrapping several statistics

12.7 Summary

**Part IV Advanced methods :**

*13 Generalized linear models :*

13.1 Generalized linear models and the glm() function

The glm() function ¦ Supporting functions ¦ Model fit and regression

diagnostics

13.2 Logistic regression

Interpreting the model parameters ¦ Assessing the impact of predictors on the

probability of an outcome ¦ Overdispersion ¦ Extensions

13.3 Poisson regression

Interpreting the model parameters ¦ Overdispersion ¦ Extensions

13.4 Summary

*14 Principal components and factor analysis :*

14.1 Principal components and factor analysis in R

14.2 Principal components 334

Selecting the number of cmponents to extract

Extracting principal components ¦ Rotating principal components

Obtaining principal components scores

14.3 Exploratory factor analysis

Deciding how many common factors to extract ¦ Extracting common

factors ¦ Rotating factors ¦ Factor scores ¦ Other EFA-related

packages

14.4 Other latent variable models

14.5 Summary

*15 Advanced methods for missing data :*

15.1 Steps in dealing with missing data

15.2 Identifying missing values

15.3 Exploring missing values patterns

Tabulating missing values ¦ Exploring missing data visually ¦ Using

correlations to explore missing values

15.4 Understanding the sources and impact of missing data

15.5 Rational approaches for dealing with incomplete data

15.6 Complete-case analysis (listwise deletion)

15.7 Multiple imputation

15.8 Other approaches to missing data

Pairwise deletion ¦ Simple (nonstochastic) imputation

15.9 Summary

*16 Advanced graphics:*

16.1 The four graphic systems in R

16.2 The lattice package

Conditioning variables ¦ Panel functions ¦ Grouping variables

Graphic parameters ¦ Page arrangement

16.3 The ggplot2 package

16.4 Interactive graphs

Interacting with graphs: identifying points ¦ playwith

latticist ¦ Interactive graphics with the iplots package ¦ rggobi

16.5 Summary