| |
| |
Introduction | |
| |
| |
| |
Introducing R: What It Is and How to Get It | |
| |
| |
Getting the Hang of R | |
| |
| |
The R Website | |
| |
| |
Downloading and Installing R from CRAN | |
| |
| |
Installing R on Your Windows Computer | |
| |
| |
Installing R on Your Macintosh Computer | |
| |
| |
Installing R on Your Linux Computer | |
| |
| |
Running the R Program | |
| |
| |
Finding Your Way with R | |
| |
| |
Getting Help via the CRAN Website and the Internet | |
| |
| |
The Help Command in R | |
| |
| |
Help for Windows Users | |
| |
| |
Help for Macintosh Users | |
| |
| |
Help for Linux Users | |
| |
| |
Help For All Users | |
| |
| |
Anatomy of a Help Item in R | |
| |
| |
Command Packages | |
| |
| |
Standard Command Packages | |
| |
| |
What Extra Packages Can Do for You | |
| |
| |
How to Get Extra Packages of R Commands | |
| |
| |
How to Install Extra Packages for Windows Users | |
| |
| |
How to Install Extra Packages for Macintosh Users | |
| |
| |
How to Install Extra Packages for Linux Users | |
| |
| |
Running and Manipulating Packages | |
| |
| |
Loading Packages | |
| |
| |
Windows-Specific Package Commands | |
| |
| |
Macintosh-Specific Package Commands | |
| |
| |
Removing or Unloading Packages | |
| |
| |
Summary | |
| |
| |
| |
Starting Out: Becoming Familiar with R | |
| |
| |
Some Simple Math | |
| |
| |
Use R Like a Calculator | |
| |
| |
Storing the Results of Calculations | |
| |
| |
Reading and Getting Data into R | |
| |
| |
Using the combine Command for Making Data | |
| |
| |
Entering Numerical Items as Data | |
| |
| |
Entering Text Items as Data | |
| |
| |
Using the scan Command for Making Data | |
| |
| |
Entering Text as Data | |
| |
| |
Using the Clipboard to Make Data | |
| |
| |
Reading a File of Data from a Disk | |
| |
| |
Reading Bigger Data Files | |
| |
| |
The read.csv() Command | |
| |
| |
Alternative Commands for Reading Data in R | |
| |
| |
Missing Values in Data Files | |
| |
| |
Viewing Named Objects | |
| |
| |
Viewing Previously Loaded Named-Objects | |
| |
| |
Viewing All Objects | |
| |
| |
Viewing Only Matching Names | |
| |
| |
Removing Objects from R | |
| |
| |
Types of Data Items | |
| |
| |
Number Data | |
| |
| |
Text Items | |
| |
| |
Converting Between Number and Text Data | |
| |
| |
The Structure of Data Items | |
| |
| |
Vector Items | |
| |
| |
Data Frames | |
| |
| |
Matrix Objects | |
| |
| |
List Objects | |
| |
| |
Examining Data Structure | |
| |
| |
Working with History Commands | |
| |
| |
Using History Files | |
| |
| |
Viewing the Previous Command History | |
| |
| |
Saving and Recalling Lists of Commands | |
| |
| |
Alternative History Commands in Macintosh OS | |
| |
| |
Editing History Files | |
| |
| |
Saving Your Work in R | |
| |
| |
Saving the Workspace on Exit | |
| |
| |
Saving Data Files to Disk | |
| |
| |
Save Named Objects | |
| |
| |
Save Everything | |
| |
| |
Reading Data Files from Disk | |
| |
| |
Saving Data to Disk as Text Files | |
| |
| |
Writing Vector Objects to Disk | |
| |
| |
Writing Matrix and Data Frame Objects to Disk | |
| |
| |
Writing List Objects to Disk | |
| |
| |
Converting List Objects to Data Frames | |
| |
| |
Summary | |
| |
| |
| |
Starting Out: Working With Objects | |
| |
| |
Manipulating Objects | |
| |
| |
Manipulating Vectors | |
| |
| |
Selecting and Displaying Parts of a Vector | |
| |
| |
Sorting and Rearranging a Vector | |
| |
| |
Returning Logical Values from a Vector | |
| |
| |
Manipulating Matrix and Data Frames | |
| |
| |
Selecting and Displaying Parts of a Matrix or Data Frame | |
| |
| |
Sorting and Rearranging a Matrix or Data Frame | |
| |
| |
Manipulating Lists | |
| |
| |
Viewing Objects within Objects | |
| |
| |
Looking Inside Complicated Data Objects | |
| |
| |
Opening Complicated Data Objects | |
| |
| |
Quick Looks at Complicated Data Objects | |
| |
| |
Viewing and Setting Names | |
| |
| |
Rotating Data Tables | |
| |
| |
Constructing Data Objects | |
| |
| |
Making Lists | |
| |
| |
Making Data Frames | |
| |
| |
Making Matrix Objects | |
| |
| |
Re-ordering Data Frames and Matrix Objects | |
| |
| |
Forms of Data Objects: Testing and Converting | |
| |
| |
Testing to See What Type of Object You Have | |
| |
| |
Converting from One Object Form to Another | |
| |
| |
Convert a Matrix to a Data Frame | |
| |
| |
Convert a Data Frame into a Matrix | |
| |
| |
Convert a Data Frame into a List | |
| |
| |
Convert a Matrix into a List | |
| |
| |
Convert a List to Something Else | |
| |
| |
Summary | |
| |
| |
| |
Data: Descriptive Statistics and Tabulation | |
| |
| |
Summary Commands | |
| |
| |
Summarizing Samples | |
| |
| |
Summary Statistics for Vectors | |
| |
| |
Summary Commands With Single Value Results | |
| |
| |
Summary Commands With Multiple Results | |
| |
| |
Cumulative Statistics | |
| |
| |
Simple Cumulative Commands | |
| |
| |
Complex Cumulative Commands | |
| |
| |
Summary Statistics for Data Frames | |
| |
| |
Generic Summary Commands for Data Frames | |
| |
| |
Special Row and Column Summary Commands | |
| |
| |
The apply() Command for Summaries on Rows or Columns | |
| |
| |
Summary Statistics for Matrix Objects | |
| |
| |
Summary Statistics for Lists | |
| |
| |
Summary Tables | |
| |
| |
Making Contingency Tables | |
| |
| |
Creating Contingency Tables from Vectors | |
| |
| |
Creating Contingency Tables from Complicated Data | |
| |
| |
Creating Custom Contingency Tables | |
| |
| |
Creating Contingency Tables from Matrix Objects | |
| |
| |
Selecting Parts of a Table Object | |
| |
| |
Converting an Object into a Table | |
| |
| |
Testing for Table Objects | |
| |
| |
Complex (Flat) Tables | |
| |
| |
Making �Flat� Contingency Tables | |
| |
| |
Making Selective �Flat� Contingency Tables | |
| |
| |
Testing �Flat� Table Objects | |
| |
| |
Summary Commands for Tables | |
| |
| |
Cross Tabulation | |
| |
| |
Testing Cross-Table (xtabs) Objects | |
| |
| |
A Better Class Test | |
| |
| |
Recreating Original Data from a Contingency Table | |
| |
| |
Switching Class | |
| |
| |
Summary | |
| |
| |
| |
Data: Distrib ution | |
| |
| |
Looking at the Distribution of Data | |
| |
| |
Stem and Leaf Plot | |
| |
| |
Histograms | |
| |
| |
Density Function | |
| |
| |
Using the Density Function to Draw a Graph | |
| |
| |
Adding Density Lines to Existing Graphs | |
| |
| |
Types of Data Distribution | |
| |
| |
The Normal Distribution | |
| |
| |
Other Distributions | |
| |
| |
Random Number Generation and Control | |
| |
| |
Random Numbers and Sampling | |
| |
| |
The Shapiro-Wilk Test for Normality | |
| |
| |
The Kolmogorov-Smirnov Test | |
| |
| |
Quantile-Quantile Plots | |
| |
| |
A Basic Normal Quantile-Quantile Plot | |
| |
| |
Adding a Straight Line to a QQ Plot | |
| |
| |
Plotting the Distribution of One Sample Against Another | |
| |
| |
Summary | |
| |
| |
| |
Si mple Hypothesis Testing | |
| |
| |
Using the Student’s t-test | |
| |
| |
Two-Sample t-Test with Unequal Variance | |
| |
| |
Two-Sample t-Test with Equal Variance | |
| |
| |
One-Sample t-Testing | |
| |
| |
Using Directional Hypotheses | |
| |
| |
Formula Syntax and Subsetting Samples in the t-Test | |
| |
| |
The Wilcoxon U-Test (Mann-Whitney) | |
| |
| |
Two-Sample U-Test | |
| |
| |
One-Sample U-Test | |
| |
| |
Using Directional Hypotheses | |
| |
| |
Formula Syntax and Subsetting Samples in the U-test | |
| |
| |
Paired t- and U-Tests | |
| |
| |
Correlation and Covariance | |
| |
| |
Simple Correlation | |
| |
| |
Covariance | |
| |
| |
Significance Testing in Correlation Tests | |
| |
| |
Formula Syntax | |
| |
| |
Tests for Association | |
| |
| |
Multiple Categories: Chi-Squared Tests | |
| |
| |
Monte Carlo Simulation | |
| |
| |
Yates’ Correction for 2 n 2 Tables | |
| |
| |
Single Category: Goodness of Fit Tests | |
| |
| |
Summary | |
| |
| |
| |
Introduction to Graphical Analysis | |
| |
| |
Box-whisker Plots | |
| |
| |
Basic Boxplots | |
| |
| |
Customizing Boxplots | |
| |
| |
Horizontal Boxplots | |
| |
| |
Scatter Plots | |
| |
| |
Basic Scatter Plots | |
| |
| |
Adding Axis Labels | |
| |
| |
Plotting Symbols | |
| |
| |
Setting Axis Limits | |
| |
| |
Using Formula Syntax | |
| |
| |
Adding Lines of Best-Fit to Scatter Plots | |
| |
| |
Pairs Plots (Multiple Correlation Plots) | |
| |
| |
Line Charts | |
| |
| |
Line Charts Using Numeric Data | |
| |
| |
Line Charts Using Categorical Data | |
| |
| |
Pie Charts | |
| |
| |
Cleveland Dot Charts | |
| |
| |
Bar Charts | |
| |
| |
Single-Category Bar Charts | |
| |
| |
Multiple Category Bar Charts | |
| |
| |
Stacked Bar Charts | |
| |
| |
Grouped Bar Charts | |
| |
| |
Horizontal Bars | |
| |
| |
Bar Charts from Summary Data | |
| |
| |
Copy Graphics to Other Applications | |
| |
| |
Use Copy/Paste to Copy Graphs | |
| |
| |
Save a Graphic to Disk | |
| |
| |
Windows | |
| |
| |
Macintosh | |
| |
| |
Linux | |
| |
| |
Summary | |
| |
| |
| |
Formula Notation and Complex Statistic s | |
| |
| |
Examples of Using Formula Syntax for Basic Tests | |
| |
| |
Formula Notation in Graphics | |
| |
| |
Analysis of Variance (ANOVA) | |
| |
| |
One-Way ANOVA | |
| |
| |
Stacking the Data before Running Analysis of Variance | |
| |
| |
Running aov() Commands | |
| |
| |
Simple Post-hoc Testing | |
| |
| |
Extracting Means from aov() Models | |
| |
| |
Two-Way ANOVA | |
| |
| |
More about Post-hoc Testing | |
| |
| |
Graphical Summary of ANOVA | |
| |
| |
Graphical Summary of Post-hoc Testing | |
| |
| |
Extracting Means and Summary Statistics | |
| |
| |
Model Tables | |
| |
| |
Table Commands | |
| |
| |
Interaction Plots | |
| |
| |
More Complex ANOVA Models | |
| |
| |
Other Options for aov() | |
| |
| |
Replications and Balance | |
| |
| |
Summary | |
| |
| |
| |
Manipulating Data and Extracting Components | |
| |
| |
Creating Data for Complex Analysis | |
| |
| |
Data Frames | |
| |
| |
Matrix Objects | |
| |
| |
Creating and Setting Factor Data | |
| |
| |
Making Replicate Treatment Factors | |
| |
| |
Adding Rows or Columns | |
| |
| |
Summarizing Data | |
| |
| |
Simple Column and Row Summaries | |
| |
| |
Complex Summary Functions | |
| |
| |
The rowsum() Command | |
| |
| |
The apply() Command | |