Contents

Chapter 1: Introducing R: What It Is and How to Get It

Getting the Hang of R

The R Website

Downloading and Installing R from CRAN

Running the R Program

Finding Your Way with R

Getting Help via the CRAN Website and the Internet

The Help Command in R

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

Running and Manipulating Packages

Summary

Chapter 2: 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

Using the scan Command for Making Data

Reading Bigger Data Files

Viewing Named Objects

Viewing Previously Loaded Named-Objects

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

Editing History Files

Saving Your Work in R

Saving the Workspace on Exit

Saving Data Files to Disk

Reading Data Files from Disk

Saving Data to Disk as Text Files

Summary

Chapter 3: Starting Out: Working With Objects

Manipulating Objects

Manipulating Vectors

Manipulating Matrix and Data Frames

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

Summary

Chapter 4: Data: Descriptive Statistics and Tabulation

Summary Commands

Summarizing Samples

Summary Statistics for Vectors

Cumulative Statistics

Summary Statistics for Data Frames

Summary Statistics for Matrix Objects

Summary Statistics for Lists

Summary Tables

Making Contingency Tables

Selecting Parts of a Table Object

Converting an Object into a Table

Testing for Table Objects

Complex (Flat) Tables

Testing “Flat” Table Objects

Summary Commands for Tables

Cross Tabulation

Summary

Chapter 5: Data: Distribution

Looking at the Distribution of Data

Stem and Leaf Plot

Histograms

Density Function

Types of Data Distribution

The Shapiro-Wilk Test for Normality

The Kolmogorov-Smirnov Test

Quantile-Quantile Plots

Summary

Chapter 6: Simple 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

Single Category: Goodness of Fit Tests

Summary

Chapter 7: 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

Horizontal Bars

Bar Charts from Summary Data

Copy Graphics to Other Applications

Use Copy/Paste to Copy Graphs

Save a Graphic to Disk

Summary

Chapter 8: Formula Notation and Complex Statistics

Examples of Using Formula Syntax for Basic Tests

Formula Notation in Graphics

Analysis of Variance (ANOVA)

One-Way ANOVA

Simple Post-hoc Testing

Extracting Means from aov() Models

Two-Way ANOVA

Extracting Means and Summary Statistics

Interaction Plots

More Complex ANOVA Models

Other Options for aov()

Summary

Chapter 9: 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

Summary

Chapter 10: Regression (Linear Modeling)

Simple Linear Regression

Linear Model Results Objects

Similarity between lm() and aov()

Multiple Regression

Formulae and Linear Models

Model Building

Curvilinear Regression

Logarithmic Regression

Polynomial Regression

Plotting Linear Models and Curve Fitting

Best-Fit Lines

Confidence Intervals on Fitted Lines

Summarizing Regression Models

Diagnostic Plots

Summary of Fit

Summary

Chapter 11: More About Graphs

Adding Elements to Existing Plots

Error Bars

Adding Legends to Graphs

Adding Text to Graphs

Adding Points to an Existing Graph

Adding Various Sorts of Lines to Graphs

Matrix Plots (Multiple Series on One Graph)

Multiple Plots in One Window

Splitting the Plot Window into Equal Sections

Splitting the Plot Window into Unequal Sections

Exporting Graphs

Using Copy and Paste to Move a Graph

Saving a Graph to a File

Using the Device Driver to Save a Graph to Disk

Summary

Chapter 12: Writing Your Own Scripts: Beginning to Program

Copy and Paste Scripts

Make Your Own Help File as Plain Text

Using Annotations with the # Character

Creating Simple Functions

One-Line Functions

Using Default Values in Functions

Simple Customized Functions with Multiple Lines

Storing Customized Functions

Making Source Code

Displaying the Results of Customized Functions and Scripts

Displaying Messages as Part of Script Output

Summary

Appendix: Answers to Exercises

Chapter 1

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Exercise 4 Solution

Exercise 5 Solution

Chapter 2

Exercise 1 Solution

Exercise 2 Solution

Chapter 3

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Exercise 4 Solution

Chapter 4

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Chapter 5

Exercise 1 Solution

Exercise 2 Solution

Chapter 6

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Exercise 4 Solution

Exercise 5 Solution

Chapter 7

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Exercise 4 Solution

Exercise 5 Solution

Chapter 8

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Exercise 4 Solution

Exercise 5 Solution

Chapter 9

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Exercise 4 Solution

Exercise 5 Solution

Chapter 10

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Exercise 4 Solution

Exercise 5 Solution

Chapter 11

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Exercise 4 Solution

Chapter 12

Exercise 1 Solution

Exercise 2 Solution

Exercise 3 Solution

Exercise 4 Solution

Exercise 5 Solution

Introduction

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.232.187