The R Book
eBook - ePub

The R Book

Michael J. Crawley

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

The R Book

Michael J. Crawley

Book details
Book preview
Table of contents
Citations

About This Book

Hugely successful and popular text presenting an extensive and comprehensive guide for all R users

The R language is recognized as one of the most powerful and flexible statistical software packages, enabling users to apply many statistical techniques that would be impossible without such software to help implement such large data sets. R has become an essential tool for understanding and carrying out research.

This edition:

  • Features full colour text and extensive graphics throughout.
  • Introduces a clear structure with numbered section headings to help readers locate information more efficiently.
  • Looks at the evolution of R over the past five years.
  • Features a new chapter on Bayesian Analysis and Meta-Analysis.
  • Presents a fully revised and updated bibliography and reference section.
  • Is supported by an accompanying website allowing examples from the text to be run by the user.

Praise for the first edition:

'…if you are an R user or wannabe R user, this text is the one that should be on your shelf. The breadth of topics covered is unsurpassed when it comes to texts on data analysis in R.' ( The American Statistician, August 2008)

'The High-level software language of R is setting standards in quantitative analysis. And now anybody can get to grips with it thanks to The R Book…' ( Professional Pensions, July 2007)

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is The R Book an online PDF/ePUB?
Yes, you can access The R Book by Michael J. Crawley in PDF and/or ePUB format, as well as other popular books in Matematica & Probabilità e statistica. We have over one million books available in our catalogue for you to explore.

Information

Publisher
Wiley
Year
2012
ISBN
9781118448960
1
Getting Started
1.1 How to use this book
Try to put yourself in one of the following categories, then go to the appropriate category heading within this section to find some suggestions about how you might get best value from this book:
  • Beginner in both computing and statistics (Section 1.1.1);
  • Student needing help with project work (1.1.2);
  • Done some R and some statistics, but keen to learn more of both (1.1.3);
  • Done regression and ANOVA, but want to learn more advanced statistical modelling (1.1.4);
  • Experienced in statistics, but a beginner in R (1.1.5);
  • Experienced in computing, but a beginner in R (1.1.6);
  • Familiar with statistics and computing, but need a friendly reference manual (1.1.7).
1.1.1 Beginner in both computing and statistics
The book is structured principally with you in mind. There are six key things to learn: how to arrange your data, how to read the data into R, how to check the data once within R, how to select the appropriate statistical model and apply it correctly, how to interpret the output, and how to present the analysis for publication. It is essential that you understand the basics thoroughly before trying to do the more complicated things, so study Chapters 3–6 carefully to begin with. Do all of the exercises that are illustrated in the text on your own computer. Now you need to do the hard part, which is selecting the right statistics to use. Model choice is extremely important, and is the thing that will develop most with experience. Do not by shy to ask for expert help with this. Never do an analysis that is more complicated than it needs to be, so start by reading about the classical tests to see if one of these fits your purposes (Chapter 8). Finally, try to understand the distinction between regression (Chapter 10) where the explanatory variable is continuous, and analysis of variance (Chapter 11), where the explanatory variable is categorical. One of these two is likely to be the most complicated method you will need.
1.1.2 Student needing help with project work
The first thing to ensure is that you know the difference between your response variable and your explanatory variable, and the distinction between a continuous variable and a categorical variable (Chapter 5). Once you have mastered this, then use the key at the beginning of Chapter 9 to see what kind of statistics you need to employ. It is most likely that if your response variable is a count, where you typically have lots of zeros, then you will want to use either the classical tests (Chapter 8) or count data in tables (Chapter 15). If your response variable is a continuous measure (e.g. a weight) then you will want to use either regression (Chapter 10) if your explanatory variable is continuous (e.g. an altitude) or analysis of variance (Chapter 11) if your explanatory variable is categorical (e.g. genotype). Do not forget to use the appropriate graphics (scatter plots for regressions, box and whisker plots for ANOVA).
1.1.3 Done some R and some statistics, but keen to learn more of both
The best plan is to skim quickly through the introductory material in case you have missed out on some of the basics. Certainly you should read all of the material in Chapter 2 on the fundamentals of the R language and Chapter 5 on graphics. Then, if you know what statistical models you want to use, go directly to the relevant chapter (e.g. regression in Chapter 10 and then non-linear regression in Chapter 20). Use the index for finding help on specific topics.
1.1.4 Done regression and ANOVA, but want to learn more advanced statistical modelling
If you learned regression and ANOVA in another language, the best plan is to go directly to Chapters 10–12 to see how the output from linear models is handled by R. Once you have familiarized yourself with data input (Chapter 3) and dataframes (Chapter 4), you should be able to go directly to the chapters on generalized linear models (Chapter 13), spatial statistics (Chapter 26), survival analysis (Chapter 27), non-linear models (Chapter 20) or mixed-effects models (Chapter 19) without any difficulty.
1.1.5 Experienced in statistics, but a beginner in R
The first thing is to get a thorough understanding of dataframes and data input to R, for which you should study Chapters 3 and 4. Then, if you know what statistics you want to do (e.g. mixed-effects models in R), you should be able to go straight to the appropriate material (Chapter 19 in this case). To understand the output from models in R, you will want to browse Chapter 9 on statistical modelling in R. Then you will want to present your data in the most effective way, by reading Chapter 5 on graphics and Chapter 29 on changing the look of graphics.
1.1.6 Experienced in computing, but a beginner in R
Well-written R code is highly intuitive and very readable. The most unfamiliar parts of R are likely to be the way it handles functions and the way it deals with environments. It is impossible to anticipate the order in which more advanced users are likely to encounter material and hence want to learn about specific features of the language, but vectorized calculations, subscripts on dataframes, function-writing and suchlike are bound to crop up early (Chapter 2). If you see a name in some code, and you want to find out about it, just type the name immediately after a question mark at the R prompt >. If, for example, you want know what rnbinom does, type:
?rnbinom
Recognizing mathematical functions is quite straightforward because of their names and the fact that their arguments are enclosed in round brackets (). Subscripts on objects have square brackets [ ]. Multi-line blocks of R code are enclosed within curly brackets { }. Again, you may not be familiar with lists, or with applying functions to lists; elements...

Table of contents

Citation styles for The R Book

APA 6 Citation

Crawley, M. (2012). The R Book (2nd ed.). Wiley. Retrieved from https://www.perlego.com/book/1010482/the-r-book-pdf (Original work published 2012)

Chicago Citation

Crawley, Michael. (2012) 2012. The R Book. 2nd ed. Wiley. https://www.perlego.com/book/1010482/the-r-book-pdf.

Harvard Citation

Crawley, M. (2012) The R Book. 2nd edn. Wiley. Available at: https://www.perlego.com/book/1010482/the-r-book-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Crawley, Michael. The R Book. 2nd ed. Wiley, 2012. Web. 14 Oct. 2022.