
ii
5. Linear (Multiple Regression) Models and Analysis of Variance..............................................................39
5.1 The Model Formula in Straight Line Regression .....................................................................................39
5.2 Regression Objects ...................................................................................................................................40
5.3 Model Formulae, and the X Matrix..........................................................................................................41
5.4 Multiple Linear Regression Models..........................................................................................................43
5.5 Polynomial and Spline Regression...........................................................................................................45
5.6 Using Factors in R Models.......................................................................................................................48
5.7 Multiple Lines – Different Regression Lines for Different Species...........................................................51
5.8 aov models (Analysis of Variance) ...........................................................................................................52
5.9 Exercises...................................................................................................................................................54
5.10 References...............................................................................................................................................55
6. Multivariate and Tree-Based Methods.......................................................................................................57
6.1 Multivariate EDA, and Principal Components Analysis ..........................................................................57
6.2 Cluster Analysis........................................................................................................................................58
6.3 Discriminant Analysis...............................................................................................................................58
6.4 Decision Tree models (Tree-based models)..............................................................................................60
6.5 Exercises...................................................................................................................................................60
6.6 References.................................................................................................................................................60
*7. R Data Structures.......................................................................................................................................63
7.1 Vectors......................................................................................................................................................63
7.2 Missing Values..........................................................................................................................................63
7.3 Data frames ..............................................................................................................................................64
7.4 Data Entry ................................................................................................................................................65
7.5 Factors and Ordered Factors...................................................................................................................67
7.6 Ordered Factors.......................................................................................................................................68
7.7 Lists...........................................................................................................................................................68
*7.8 Matrices and Arrays...............................................................................................................................69
7.9 Different Types of Attachments.................................................................................................................70
7.10 Exercises.................................................................................................................................................70
8. Useful Functions ...........................................................................................................................................73
8.1 Confidence Intervals and Tests.................................................................................................................73
8.2 Matching and Ordering............................................................................................................................73
8.3 String Functions .......................................................................................................................................73
8.4 Application of a Function to the Columns of an Array or Data Frame....................................................74
*8.5 tapply() ...................................................................................................................................................74
8.6 Splitting Vectors and Data Frames Down into Lists – split()...................................................................76
*8.7 Merging Data Frames ............................................................................................................................76
8.8 Dates.........................................................................................................................................................76
评论3