Understanding and Applying Basic Statistical Methods using R

By George Ross Ihaka
316
2026

Description

Computational skills are kept to a minimum in the book by including R script programs. Students are not required to master the writing of R script programs, but explanations of how the programs work and program output are included in each chapter. R is a statistical package with an extensive library of functions that offers flexibility in writing customized statistical routines. The R script commands are run in the R Studio software which is a graphical user interface for Windows. The R Studio software makes accessing R programs, viewing output from the exercises, and graph displays easier for the student. This book is intended as a guide to data analysis with the R system for statistical computing. R is an environment incorporating an implementation of the S programming language, which is powerful, flexible and has excellent graphical facilities. In the book we aim to give relatively brief and straightforward descriptions of how to conduct a range of statistical analyses using R. Each chapter deals with the analysis appropriate for one or several data sets. A brief account of the relevant statistical background is included in each chapter along with appropriate references, but our prime focus is on how to use R and how to interpret results. We hope the book will provide students and researchers in many disciplines with a self-contained means of using R to analyse their data. R is an open-source project developed by dozens of volunteers for more than ten years now and is available from the Internet under the General Public Licence. R has become the lingua franca of statistical computing. Increasingly, implementations of new statistical methodology first appear as R add-on packages. In some communities, such as in bioinformatics, R already is the primary workhorse for statistical analyses. Because the sources of the R system are open and available to everyone without restrictions and because of its powerful language and graphical capabilities, R has started to become the main computing engine for reproducible statistical research. For a reproducible piece of research, the original observations, all data preprocessing steps, the statistical analysis as well as the scientific report form a unity and all need to be available for inspection, reproduction and modification by the readers. Reproducibility is a natural requirement for textbooks such as the book and therefore this book is fully reproducible using an R version greater or equal to 2.4.0. All analyses and results, including figures and tables, can be reproduced by the reader without having to retype a single line of R code.

About Author

George Ross Ihaka is a New Zealand statistician, an Associate Professor of Statistics at the University of Auckland. Ihaka completed his undergraduate education at the University of Auckland, and obtained his PhD from the University of California, Berkeley. His thesis was titled Ruaumoko, after the Māori god of earthquakes, volcanoes and seasons. Along with Robert Gentleman, he is one of the originators of the R programming language. In 2008, he received the Pickering Medal, awarded by the Royal Society of New Zealand, for his work on R. As of 2010, he was working on a new statistical programming language based on Lisp. Many inventors seek fame and fortune, or at least recognition. This isn't the case for New Zealand statistician and associate professor George Ross Ihaka. Despite being the co-creator of R, an open-source programming language used by millions and loved by the likes of Google and the Bank of America, he remains modest and bighearted. Always resisting the pressure to commercialize his brainchild.

Table of Content

Preface
Chapter 1. Introduction to Statistics and R

What is Statistics? Types and Importance
Installing and Using R and RStudio
The R Console and Script Editor
Packages and Libraries (install.packages, library)
Data Types and Structures in R
Setting and Getting the Working Directory

Chapter 2. Organizing and Summarizing Data
Types of Data: Categorical vs Numerical
Frequency Tables and Relative Frequencies
Measures of Central Tendency (Mean, Median, Mode)
Measures of Dispersion (Range, Variance, SD)
Five-number Summary and Boxplots

Chapter 3. Data Visualization in R
Bar Charts and Pie Charts
Histograms and Density Plots
Boxplots and Violin Plots
Scatterplots and Line Graphs
Customizing Plots with ggplot2
Multi-panel Plots with par() and facet_wrap()

Chapter 4. Probability Basics
Basic Probability Rules and Set Notation
Conditional Probability and Bayes’ Theorem
Independent and Dependent Events
Permutations and Combinations


 
Chapter 5. Probability Distributions
Discrete vs Continuous Distributions
Binomial Distribution in R (dbinom, rbinom)
Normal Distribution (dnorm, rnorm, pnorm)
Poisson and Exponential Distributions
Visualizing Distributions in R

Chapter 6. Sampling and Sampling Distributions
Populations vs Samples
Random Sampling Methods
Sampling Distributions of the Mean
Law of Large Numbers

Chapter 7. Estimation and Confidence Intervals
Point Estimation and Interval Estimation
Confidence Intervals for Means
Confidence Intervals for Proportions
Margin of Error and Sample Size

Chapter 8. Hypothesis Testing Fundamentals
Null and Alternative Hypotheses
y p-values and Significance Levels
One-tailed vs Two-tailed Tests

Chapter 9. Comparing Two Groups
Independent Samples t-test
Paired Samples t-test
Mann-Whitney U Test (Non-parametric)
Interpreting Test Outputs in R

Bibliography
Index