Home Page Icon
Home Page
Table of Contents for
Chapter 10
Close
Chapter 10
by John M. Quick
Statistical Analysis with R Beginner's Guide
Statistical Analysis with R
Table of Contents
Statistical Analysis with R
Credits
About the Author
About the Reviewers
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Time for action - heading
What just happened?
Pop quiz - heading
Have a go hero - heading
Reader feedback
Customer support
Errata
Piracy
Questions
1. Uncovering the Strategist's Data Analysis Tool
What is R?
What are the benefits of using R?
Why should I use R?
Why should I read this book?
What topics are covered in this book?
Chapter 2 — Preparing R for Battle
Chapter 3 — Exploring the Mysterious Data Analysis Tool
Chapter 4 — Collecting and Organizing Information
Chapter 5 — Assessing the Situation
Chapter 6 — Planning the Attack
Chapter 7 — Organizing the Battle Plans
Chapter 8 — Briefing the Emperor
Chapter 9 — Briefing the Generals
Chapter 10 — Becoming a Master Strategist
Summary
2. Preparing R for Battle
Time for action - downloading and installing R
Example: R 2.11.1 Mac OS X 10.5+ installation wizard demonstration
What just happened?
Time for action - issuing your first R command
What just happened?
Time for action - setting your R working directory
What just happened?
Pop quiz
Have a go hero
Summary
3. Exploring the Mysterious Data Analysis Tool
Deciphering Zhuge Liang's magic square
Time for action - solving the first 4x4 magic square
What just happened?
Lines
Comments
Calculations
Output
Visualizing the R console
Pop quiz
Have a go hero
Summary
4. Collecting and Organizing Information
Time for action - importing external data
What just happened?
read.csv(file)
comma-separated values (csv) files
Pop quiz
Time for action - creating and calling variables
What just happened?
Pop quiz
Have a go hero
Time for action - accessing data within variables
What just happened?
variable$column notation
attach(variable) function
variable[row, column] notation
Pop quiz
Time for action - manipulating variable data
What just happened?
Performing a calculation on an entire dataset
Performing a calculation on a row, column, or cell
Using variable data in function arguments
Saving a variable calculation into a new variable
Pop quiz
Have a go hero
Time for action - managing the R workspace
What just happened?
Listing the contents of the R workspace
Saving the contents of the R workspace
Loading the contents of the R workspace
Quitting R
Distinguishing between the R console and workspace
Saving the R console
Pop quiz
Have a go hero
Summary
5. Assessing the Situation
Time for action - making an initial inference from our data
What just happened?
Examining our data
Time for action - creating a subset from a large dataset
What just happened?
Multi-argument functions
Variable-argument functions
Equivalency operators
subset(data, ...)
Pop quiz
Have a go hero
Time for action - deriving summary statistics
What just happened?
Means
Standard deviations
Ranges
summary(object)
Why use summary statistics?
Pop quiz
Have a go hero
Time for action - quantifying categorical variables
What just happened?
as.numeric(data)
Overwriting variables
Pop quiz
Have a go hero
Time for action - correlating variables
What just happened?
Interpreting correlations
cor(x, y)
cor(data)
NA values
Pop quiz
Have a go hero
Regression
Time for action - modelling with simple linear regression
What just happened?
lm(formula, data)
Linear model output
Linear model summary
Interpreting a linear regression model
Pop quiz
Time for action - modelling with multiple linear regression
What just happened?
Interpreting the summary output
Explaining model differences
Pop quiz
Have a go hero
Time for action - modelling interactions
What just happened?
Interpreting interaction variables
Pop quiz
Have a go hero
Time for action - comparing and choosing models
What just happened?
Interpreting the model summaries
Interpreting the ANOVA results
anova(object, ...)
Pop quiz
Have a go hero
Summary
6. Planning the Attack
Review of models
Head to head
Surround
Ambush
Fire
Predicting outcomes using regression models
Rating
Successfully executed
Number of Wei soldiers
Duration of battle
A word about assumptions
Time for action - calculating outcomes from regression models
What just happened?
Time for action - creating custom functions
What just happened?
function()
Extended lines
Pop quiz
Have a go hero
Time for action - creating resource-focused custom functions
What just happened?
Have a go hero
Logistical considerations
Gold
Provisions
Equipment
Soldiers
Resource and cost summary
Resource map
Time for action - incorporating resource constraints into predictions
What just happened?
Gold cost function explanation
Pop quiz
Have a go hero
Assessing viability
Time for action - assessing the viability of potential strategies
What just happened?
Remember your assumptions
Pop quiz
Have a go hero - choosing a battle plan
Summary
7. Organizing the Battle Plans
Retracing and refining a complete analysis
Time for action - first steps
What just happened?
Time for action - data setup
What just happened?
read.table(...)
Pop quiz
Time for action - data exploration
What just happened?
Pop quiz
Time for action - model development
What just happened?
glm(...)
AIC(object, ...)
Pop quiz
Time for action - model deployment
What just happened?
coef(object)
Pop quiz
Time for action - last steps
The common steps to all R analyses
Step 1: Set your working directory
Comment your work
Step 2: Import your data (or load an existing workspace)
Step 3: Explore your data
Step 4: Conduct your analysis
Step 5: Save your workspace and console files
Pop quiz
Have a go hero
Summary
8. Briefing the Emperor
Charts, graphs, and plots in R
Time for action - creating a bar chart
What just happened?
barplot(...)
Vectors
Graphic window
Pop quiz
Time for action - customizing graphics
What just happened?
Graphic customization arguments
main, xlab, and ylab
xlim and ylim
Col
Rainbow colors
Specific colors
legend(...)
Pop quiz
Time for action - creating a scatterplot
What just happened?
Single scatterplot
Multiple scatterplots
Pop quiz
Time for action - creating a line chart
What just happened?
type
Number-colon-number notation
Pop quiz
Time for action - creating a box plot
What just happened?
boxplot(...)
Pop quiz
Time for action - creating a histogram
What just happened?
hist(...)
Pop quiz
Time for action - creating a pie chart
What just happened
pie(...)
Pop quiz
Have a go hero
Time for action - exporting graphics
What just happened?
Pop quiz
Have a go hero
Summary
9. Briefing the Generals
More charts, graphs, and plots in R
Time for action - customizing a bar chart
What just happened?
names
width and space
horiz
beside
density and angle
legend(...) with density, angle, and cex
Pop quiz
Have a go hero
Time for action - customizing a scatterplot
What just happened?
pch and cex
points(...)
legend(...)
abline(...)
Pop quiz
Have a go hero
Time for action - customizing a line chart
What just happened?
lwd
lines(...)
legend(...)
Pop quiz
Have a go hero
Time for action - customizing a box plot
What just happened?
range
axis(...)
Pop quiz
Have a go hero
Time for action - customizing a histogram
What just happened?
breaks
freq
Pop quiz
Have a go hero
Time for action - customizing a pie chart
What just happened?
Custom labels
legend(...)
Pop quiz
Have a go hero
Time for action - building a graphic
What just happened?
Pop quiz
Have a go hero
Time for action - building a graphic with multiple visuals
What just happened?
par(mfcol)
Graphics
Horizontal and vertical lines
Nested functions
Pop quiz
Have a go hero
Summary
10. Becoming a Master Strategist
R's built-in resources
Time for action - using R's help function
What just happened?
help(...)
Pop quiz
Have a go hero
Time for action - expanding R with packages
What just happened?
Choose a CRAN mirror
Install a package
Load the package
Use the package
Pop quiz
Have a go hero
R's online resources
Websites
The R Project for Statistical Computing
Quick-R
R Programming wikibook
R Graph Gallery
Crantastic!
Blogs
R bloggers
R Tutorial Series
Online communities
R-help mailing list
Other mailing lists
Search engines
R Seek
Google
Summary
A. Pop Quiz Answer Key
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Chapter 9
Next
Next Chapter
Index
Chapter 10
Using R's help function
1
c
2
b
Expanding R with packages
1
b
2
a
3
b
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset