Jump to main navigation


Tutorials on R and statistics

23 April 2011

This series of tutorials will gradually work through an extensive range of frequentist and Bayesian graphical and statistical theory and practice (focusing on R or JAGS interfaced from R). It is advisable that you initially work through the following tutorials sequentially.

This tutorial series makes use of artificial data. The reasons for doing so are:
  • simulating data allows us to fabricate the true underlying trends responsible for the data and therefore enable us to evaluate how accurately the analyses tools subsequently reveal these trends.
  • the process of simulating data is typically the reverse of analysing the data. There must be consideration for how the response is to relate to the predictors, the scale (normal, binomial, Poisson etc) of variables and parameters as well as how to incorporate sensible variability (noise). Thus the process of simulating data specifically for a particular statistical analysis can be as informative as a description of the analysis itself.

Each tutorial is also associated with a workshop featuring a real data sets and research questions (many of which appear in prominent biostatistical texts). These workshops are designed to provide extensive guided practice of the concepts and techniques highlighted in the tutorials. Moreover, as worked examples of real biological data, the provide insights into the diversity of analyses options and challenges presented by real data.

R syntax

Tutorial 1 - R basics
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Installation of R
  2. Basic syntax
  3. Data types
  4. Object manipulation
  5. R Editors
«Goto Tutorial»
«Goto Worksheet»

Tutorial 2 - R Dataframes
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Constructing dataframes
  2. Importing (reading) data
  3. Exporting (writing) data
  4. Vectors within dataframes
  5. Manipulating dataframes
    1. Reshaping dataframes
    2. Merging dataframes
    3. Aggregating dataframes
    4. Transformations and derivatives
    5. Alterations
    6. List manipulations
    7. More complex manipulations
  6. Dummy data sets - random data generation
«Goto Tutorial»
«Goto Worksheet»

Tutorial 3 - More advanced R
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Package management
  2. Matrix algebra
  3. R programming
«Goto Tutorial»
«Goto Worksheet»

R data summaries - numerical and graphical

Tutorial 4 - Exploratory data analysis
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Numerical summaries
  2. Graphical summaries
«Goto Tutorial»
«Goto Worksheet»

Tutorial 5 - Traditional R graphics
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. High level plotting
  2. Graphical parameters
  3. Enhancements and customizations
  4. Exporting graphics
«Goto Tutorial»
«Goto Worksheet»

Tutorial 6 - The Grammar of Graphics in R (ggplot2)
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Introducing the grammar of graphics
  2. Coordinate systems
  3. Geometric objects - geom
  4. Scales
  5. Facets
  6. Options
  7. Themes
  8. Showcase
«Goto Tutorial»
«Goto Worksheet»

Linear modeling

Tutorial 7 - Statistical philosophies and estimation
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Distributions
  2. Probability
  3. Opposing philosophies
    1. Frequentist
    2. Bayesian
  4. Estimation and inference
    1. Least squares
    2. Maximum likelihood
    3. Bayesian
«Goto Tutorial»
«Goto Worksheet»

Tutorial 8 - Simple hypothesis testing
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Frequentist philosophy revisited
  2. One and two-tailed tests
  3. t-tests
  4. Assumptions
  5. Power
  6. Robust tests
«Goto Tutorial»
«Goto Worksheet»

Tutorial 9 - Traditional linear modelling in R
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. An introduction to linear models
  2. Regression
    1. Simple
    2. Multiple
  3. ANOVA
    1. Single factor
    2. Nested
    3. Factorial
    4. Randomized Complete Block
    5. Partly nested (split-plot and randomized block)
  4. ANCOVA
«Goto Tutorial»
«Goto Worksheet»

Tutorial 10 - The power of contrasts
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. To derive predictions
  2. To derive treatment means
  3. To derive effect sizes
«Goto Tutorial»
«Goto Worksheet»

Tutorial 11 - Generalized linear models
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. χ2 tests
  2. Contingency tables
  3. Generalized linear models
    1. Logistic regression
    2. Log-linear modelling
«Goto Tutorial»
«Goto Worksheet»

Tutorial 12 - Generalized linear mixed effects
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. χ2 tests
  2. Contingency tables
  3. Generalized linear models
    1. Logistic regression
    2. Log-linear modelling
«Goto Tutorial»
«Goto Worksheet»

Multivariate analyses

Tutorial 13 - R-mode analyses
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Principal components analysis
  2. Redundancy analysis
  3. Ordiation
«Goto Tutorial»
«Goto Worksheet»

Tutorial 14 - Q-mode analyses
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Dissimilarity
  2. Classification and regression trees, clustering
  3. Multidimensional scaling
  4. ANOSIM
  5. Mantel
«Goto Tutorial»
«Goto Worksheet»

Other topics

Tutorial 15 - Recommendations and Itemsets
«Goto Tutorial»
«Goto Worksheet»

Topics covered

  1. Itemsets
«Goto Tutorial»
«Goto Worksheet»