A First Course in Statistical Programming with R

by
Edition: 1st
Format: Paperback
Pub. Date: 2008-01-28
Publisher(s): Cambridge University Press
List Price: $57.00

Rent Textbook

Select for Price
There was a problem. Please try again later.

Digital

Rent Digital Options
Online:1825 Days access
Downloadable:Lifetime Access
$68.40
*To support the delivery of the digital material to you, a non-refundable digital delivery fee of $3.99 will be charged on each digital item.
$68.40*

New Textbook

We're Sorry
Sold Out

Used Textbook

We're Sorry
Sold Out

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

This is the only introduction you'll need to start programming in R, the open-source language that is free to download, and lets you adapt the source code for your own requirements. Co-written by one of the R Core Development Team, and by an established R author, this book comes with real R code that complies with the standards of the language. Unlike other introductory books on the ground-breaking R system, this book emphasizes programming, including the principles that apply to most computing languages, and techniques used to develop more complex projects. Learning the language is made easier by the frequent exercises and end-of-chapter reviews that help you progress confidently through the book. Solutions, datasets and any errata will be available from the book's web site. The many examples, all from real applications, make it particularly useful for anyone working in practical data analysis.

Table of Contents

Prefacep. ix
Getting startedp. 1
What is statistical programming?p. 1
Outline of the bookp. 2
The R packagep. 3
Why use a command line?p. 3
Font conventionsp. 4
Installation of Rp. 4
Introduction to the R languagep. 5
Starting and quitting Rp. 5
Recording your workp. 6
Basic features of Rp. 7
Calculating with Rp. 7
Named storagep. 7
Functionsp. 9
Exact or approximate?p. 9
R is case-sensitivep. 12
Listing the objects in the workspacep. 12
Vectorsp. 12
Extracting elements from vectorsp. 13
Vector arithmeticp. 14
Simple patterned vectorsp. 15
Missing values and other special valuesp. 16
Character vectorsp. 16
Factorsp. 17
More on extracting elements from vectorsp. 18
Matrices and arraysp. 18
Data framesp. 19
Dates and timesp. 21
Built-in functions and online helpp. 21
Built-in examplesp. 22
Finding help when you don't know the function namep. 23
Built-in graphics functionsp. 23
Additional elementary built-in functionsp. 25
Logical vectors and relational operatorsp. 26
Boolean algebrap. 26
Logical operations in Rp. 27
Relational operatorsp. 28
Data input and outputp. 29
Changing directoriesp. 29
dump () and source ()p. 29
Redirecting R outputp. 30
Saving and retrieving image filesp. 31
Data frames and the read.table functionp. 31
Listsp. 31
Chapter exercisesp. 32
Programming statistical graphicsp. 33
High-level plotsp. 33
Bar charts and dot chartsp. 34
Pie chartsp. 35
Histogramsp. 35
Box plotsp. 36
Scatterplotsp. 38
QQ plotsp. 39
Choosing a high-level graphicp. 41
Low-level graphics functionsp. 42
The plotting region and marginsp. 42
Adding to plotsp. 43
Setting graphical parametersp. 45
Chapter exercisesp. 46
Programming with Rp. 47
Flow controlp. 47
The for () loopp. 47
The if () statementp. 50
The while () loopp. 54
Newton's method for root findingp. 55
The repeat loop, and the break and next statementsp. 57
Managing complexity through functionsp. 59
What are functions?p. 59
Scope of variablesp. 62
Miscellaneous programming tipsp. 63
Using fix ()p. 63
Documentation using #p. 64
Some general programming guidelinesp. 65
Top-down designp. 67
Debugging and maintenancep. 72
Recognizing that a bug existsp. 72
Make the bug reproduciblep. 73
Identify the cause of the bugp. 73
Fixing errors and testingp. 75
Look for similar errors elsewherep. 75
The browser () and debug () functionsp. 75
Efficient programmingp. 77
Learn your toolsp. 77
Use efficient algorithmsp. 78
Measure the time your program takesp. 79
Be willing to use different toolsp. 80
Optimize with carep. 80
Chapter exercisesp. 80
Simulationp. 82
Monte Carlo simulationp. 82
Generation of pseudorandom numbersp. 83
Simulation of other random variablesp. 88
Bernoulli random variablesp. 88
Binomial random variablesp. 89
Poisson random variablesp. 93
Exponential random numbersp. 97
Normal random variablesp. 99
Monte Carlo integrationp. 101
Advanced simulation methodsp. 104
Rejection samplingp. 104
Importance samplingp. 107
Chapter exercisesp. 109
Computational linear algebrap. 112
Vectors and matrices in Rp. 113
Constructing matrix objectsp. 113
Accessing matrix elements; row and column namesp. 115
Matrix propertiesp. 117
Triangular matricesp. 118
Matrix arithmeticp. 118
Matrix multiplication and inversionp. 119
Matrix inversionp. 120
The LU decompositionp. 121
Matrix inversion in Rp. 122
Solving linear systemsp. 123
Eigenvalues and eigenvectorsp. 124
Advanced topicsp. 125
The singular value decomposition of a matrixp. 125
The Choleski decomposition of a positive definite matrixp. 126
The QR decomposition of a matrixp. 127
The condition number of a matrixp. 128
Outer productsp. 129
Kronecker productsp. 129
apply ()p. 129
Chapter exercisesp. 130
Numerical optimizationp. 132
The golden section search methodp. 132
Newton-Raphsonp. 135
The Nelder-Mead simplex methodp. 138
Built-in functionsp. 142
Linear programmingp. 142
Solving linear programming problems in Rp. 145
Maximization and other kinds of constraintsp. 145
Special situationsp. 146
Unrestricted variablesp. 149
Integer programmingp. 150
Alternatives to lp ()p. 151
Quadratic programmingp. 151
Chapter exercisesp. 157
Review of random variables and distributionsp. 158
Indexp. 161
Table of Contents provided by Ingram. All Rights Reserved.

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.