A First Course in Statistical Programming with R
by W. John Braun , Duncan J. MurdochRent Textbook
Digital
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
Table of Contents
| Preface | p. ix |
| Getting started | p. 1 |
| What is statistical programming? | p. 1 |
| Outline of the book | p. 2 |
| The R package | p. 3 |
| Why use a command line? | p. 3 |
| Font conventions | p. 4 |
| Installation of R | p. 4 |
| Introduction to the R language | p. 5 |
| Starting and quitting R | p. 5 |
| Recording your work | p. 6 |
| Basic features of R | p. 7 |
| Calculating with R | p. 7 |
| Named storage | p. 7 |
| Functions | p. 9 |
| Exact or approximate? | p. 9 |
| R is case-sensitive | p. 12 |
| Listing the objects in the workspace | p. 12 |
| Vectors | p. 12 |
| Extracting elements from vectors | p. 13 |
| Vector arithmetic | p. 14 |
| Simple patterned vectors | p. 15 |
| Missing values and other special values | p. 16 |
| Character vectors | p. 16 |
| Factors | p. 17 |
| More on extracting elements from vectors | p. 18 |
| Matrices and arrays | p. 18 |
| Data frames | p. 19 |
| Dates and times | p. 21 |
| Built-in functions and online help | p. 21 |
| Built-in examples | p. 22 |
| Finding help when you don't know the function name | p. 23 |
| Built-in graphics functions | p. 23 |
| Additional elementary built-in functions | p. 25 |
| Logical vectors and relational operators | p. 26 |
| Boolean algebra | p. 26 |
| Logical operations in R | p. 27 |
| Relational operators | p. 28 |
| Data input and output | p. 29 |
| Changing directories | p. 29 |
| dump () and source () | p. 29 |
| Redirecting R output | p. 30 |
| Saving and retrieving image files | p. 31 |
| Data frames and the read.table function | p. 31 |
| Lists | p. 31 |
| Chapter exercises | p. 32 |
| Programming statistical graphics | p. 33 |
| High-level plots | p. 33 |
| Bar charts and dot charts | p. 34 |
| Pie charts | p. 35 |
| Histograms | p. 35 |
| Box plots | p. 36 |
| Scatterplots | p. 38 |
| QQ plots | p. 39 |
| Choosing a high-level graphic | p. 41 |
| Low-level graphics functions | p. 42 |
| The plotting region and margins | p. 42 |
| Adding to plots | p. 43 |
| Setting graphical parameters | p. 45 |
| Chapter exercises | p. 46 |
| Programming with R | p. 47 |
| Flow control | p. 47 |
| The for () loop | p. 47 |
| The if () statement | p. 50 |
| The while () loop | p. 54 |
| Newton's method for root finding | p. 55 |
| The repeat loop, and the break and next statements | p. 57 |
| Managing complexity through functions | p. 59 |
| What are functions? | p. 59 |
| Scope of variables | p. 62 |
| Miscellaneous programming tips | p. 63 |
| Using fix () | p. 63 |
| Documentation using # | p. 64 |
| Some general programming guidelines | p. 65 |
| Top-down design | p. 67 |
| Debugging and maintenance | p. 72 |
| Recognizing that a bug exists | p. 72 |
| Make the bug reproducible | p. 73 |
| Identify the cause of the bug | p. 73 |
| Fixing errors and testing | p. 75 |
| Look for similar errors elsewhere | p. 75 |
| The browser () and debug () functions | p. 75 |
| Efficient programming | p. 77 |
| Learn your tools | p. 77 |
| Use efficient algorithms | p. 78 |
| Measure the time your program takes | p. 79 |
| Be willing to use different tools | p. 80 |
| Optimize with care | p. 80 |
| Chapter exercises | p. 80 |
| Simulation | p. 82 |
| Monte Carlo simulation | p. 82 |
| Generation of pseudorandom numbers | p. 83 |
| Simulation of other random variables | p. 88 |
| Bernoulli random variables | p. 88 |
| Binomial random variables | p. 89 |
| Poisson random variables | p. 93 |
| Exponential random numbers | p. 97 |
| Normal random variables | p. 99 |
| Monte Carlo integration | p. 101 |
| Advanced simulation methods | p. 104 |
| Rejection sampling | p. 104 |
| Importance sampling | p. 107 |
| Chapter exercises | p. 109 |
| Computational linear algebra | p. 112 |
| Vectors and matrices in R | p. 113 |
| Constructing matrix objects | p. 113 |
| Accessing matrix elements; row and column names | p. 115 |
| Matrix properties | p. 117 |
| Triangular matrices | p. 118 |
| Matrix arithmetic | p. 118 |
| Matrix multiplication and inversion | p. 119 |
| Matrix inversion | p. 120 |
| The LU decomposition | p. 121 |
| Matrix inversion in R | p. 122 |
| Solving linear systems | p. 123 |
| Eigenvalues and eigenvectors | p. 124 |
| Advanced topics | p. 125 |
| The singular value decomposition of a matrix | p. 125 |
| The Choleski decomposition of a positive definite matrix | p. 126 |
| The QR decomposition of a matrix | p. 127 |
| The condition number of a matrix | p. 128 |
| Outer products | p. 129 |
| Kronecker products | p. 129 |
| apply () | p. 129 |
| Chapter exercises | p. 130 |
| Numerical optimization | p. 132 |
| The golden section search method | p. 132 |
| Newton-Raphson | p. 135 |
| The Nelder-Mead simplex method | p. 138 |
| Built-in functions | p. 142 |
| Linear programming | p. 142 |
| Solving linear programming problems in R | p. 145 |
| Maximization and other kinds of constraints | p. 145 |
| Special situations | p. 146 |
| Unrestricted variables | p. 149 |
| Integer programming | p. 150 |
| Alternatives to lp () | p. 151 |
| Quadratic programming | p. 151 |
| Chapter exercises | p. 157 |
| Review of random variables and distributions | p. 158 |
| Index | p. 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.