Jump to main navigation


Tutorials and Workshops on R and statistics

02 Mar 2018

This series of tutorials and workshops 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 and associated workshops sequentially.

The 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.
Where possible and appropriate, the workshop series users real research scenarios and data gleaned largely from the worked examples of major Biostatistical texts so as to take advantage of the history and information surrounding those examples as well as any familiarity that users may have with those examples. These workshops are designed to provide extensive guided practice of the concepts and techniques highlighted in the tutorials.
The use of real data in the workshops:
  • provides a greater familiarity and appreciation of the nature and issues surrounding real data
  • provide insights into the diversity of analyses options and challenges presented by real data.
  • allows researchers to better associate the links between data and research features with analysis decisions

Hence together, the tutorials and workshops provide a rich mixture of generic and specific analytical demonstration and practice. I hope you find them useful - Enjoy!

R syntax

Topic 1 - R basics
«Goto Tutorial»

Topics covered

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

Topic 2 - R Dataframes

Topics covered

  1. Constructing dataframes Tutorial
  2. Importing (reading) and exporting (writing) dataTutorial
  3. Vectors within dataframesTutorial
  4. Manipulating dataframesTutorial
    1. Reshaping dataframes
    2. Merging dataframes
    3. Aggregating dataframes
    4. Transformations and derivatives
    5. Alterations
    6. List manipulations
    7. More complex manipulations
  5. Simulated data sets - random data generation Tutorial

Topic 3 - More advanced R

Topics covered

  1. Package management Tutorial
  2. Matrix algebra Tutorial
  3. R programming Tutorial
  4. Time formatting Tutorial

Introductory statistical principles

Topic 4 - Basic statistics

Topics covered

  1. Basic principlesTutorial
    1. Probability theory
    2. Distributions
    3. Measures of location and variability
    4. Degrees of freedom
  2. Opposing philosophiesTutorial
    1. Frequentist
    2. Bayesian
  3. Estimation and inferenceTutorial
    1. Least squares (LS)
    2. Maximum likelihood (ML)
    3. Bayesian

R data summaries - numerical and graphical

Topic 5 - R graphics

Topics covered

  1. Base R graphicsTutorial
  2. The Grammar of Graphics (ggplot2)Tutorial
  3. Exploratory data analysis Tutorial
  4. Mapping in RTutorial

Statistical modeling

Topic 6 - Simple hypothesis testing

Topics covered

  1. Frequentist philosophy revisited Tutorial
  2. t-tests Bayesian Tutorial   Frequentist Tutorial

Topic 7 - Linear models

Topics covered

  1. An introduction to linear modelsTutorial
  2. Regression
    1. Simple Bayesian Tutorial   Frequentist Tutorial
    2. Multiple Bayesian Tutorial   Frequentist Tutorial
  3. ANOVA
    1. Single factor Bayesian Tutorial   Frequentist Tutorial
    2. ANCOVA Bayesian Tutorial   Frequentist Tutorial
    3. Factorial Bayesian Tutorial   Frequentist Tutorial
  4. The power of contrastsTutorial

Topic 8 - Heterogeneity and autocorrelation

Topics covered

  1. An introduction to variance structures in linear modelsTutorial
  2. Dealing with variance heterogeneity Bayesian Tutorial   Frequentist Tutorial
  3. Dealing with temporal autocorrelation Bayesian Tutorial   Frequentist Tutorial
  4. Dealing with spatial autocorrelation Bayesian Tutorial   Frequentist Tutorial

Topic 9 - Linear mixed effects models

Topics covered

  1. An introduction to mixed effects modelsTutorial
  2. Nested Bayesian Tutorial   Frequentist Tutorial
  3. Randomize Complete Block Bayesian Tutorial   Frequentist Tutorial
  4. Partly nested (split-plot and randomized block) Bayesian Tutorial   Frequentist Tutorial

Topic 10 - Frequency analyses and generalized linear models

Topics covered

  1. An introduction to frequency analysisTutorial
  2. χ2 tests Bayesian Tutorial   Frequentist Tutorial
  3. Contingency tables Bayesian Tutorial   Frequentist Tutorial
  4. Generalized linear modelsTutorial
    1. Logistic and probit regression Bayesian Tutorial   Frequentist Tutorial
    2. Poisson regression and Log-linear modelling Bayesian Tutorial   Frequentist Tutorial

Topic 11 - Generalized linear mixed models

Topics covered

  1. Generalized linear mixed modelsTutorial
    1. GLMM Bayesian Tutorial   Frequentist Tutorial

Topic 12 - Non-linear models

Topics covered

  1. Polynomial models Bayesian Tutorial   Frequentist Tutorial
  2. Non-linear models Bayesian Tutorial   Frequentist Tutorial
  3. Lowess (loess) regression Bayesian Tutorial   Frequentist Tutorial
  4. Piecewise regression Bayesian Tutorial   Frequentist Tutorial
  5. Splines Bayesian Tutorial   Frequentist Tutorial
  6. Generalized additive models
    1. GAM Bayesian Tutorial   Frequentist Tutorial
    2. GAMM Bayesian Tutorial   Frequentist Tutorial
  7. Classification and regression trees
    1. Simple trees Bayesian Tutorial   Frequentist Tutorial
    2. Boosted regression trees Bayesian Tutorial   Frequentist Tutorial
    3. Multivariate regression trees Bayesian Tutorial   Frequentist Tutorial
  8. Integrated Nested Laplace Approximation (INLA)
    1. An introduction to INLA Tutorial
    2. INLA for (generalized) linear models Tutorial
    3. INLA for (generalized) linear mixed effects models Tutorial
    4. INLA for (generalized) non-linear mixed effects models Tutorial
    5. Spatial and spatio-temporal models with INLA Tutorial

Multivariate analyses

Topic 13 - Multivatiate data

Topics covered

  1. Overview Tutorial
  2. Diversity and Richness Tutorial
  3. Transformations and standardizations Tutorial
  4. Measures of association and distance Tutorial

Topic 14 - R-mode analyses

Topics covered

  1. Axis rotation and eigenanalyis Tutorial
  2. Unconstrained
    1. Principal Components Analysis (PCA) (Tutorial, Workshop)
    2. Correspondence Analysis (CA) (Tutorial, Workshop)
  3. Constrained
    1. Redundancy Analysis (RDA) (Tutorial, Workshop)
    2. Canonical Correspondence Analysis (CCA) (Tutorial, Workshop)

Topic 15 - Q-mode analyses

Topics covered

  1. Non-metric Multidimensional Scaling (NMDS) (Tutorial, Workshop)
  2. ANOSIM and Mantel tests (Tutorial, Workshop)
  3. Clustering (Tutorial, Workshop)

Reproducible research

Topic 17 - Document languages

Topics covered

  1. LaTeX
    1. Basic use Tutorial
    2. Tikz Tutorial
  2. HTML Tutorial
  3. Markdown Tutorial
  4. Pandoc Tutorial
    1. Markdown to pdf (Tutorial, Workshop)
    2. Markdown to html (Tutorial, Workshop)
    3. Markdown to slides (Tutorial, Workshop)

Topic 18 - knitr

Topics covered

  1. Overview Tutorial
  2. HTML specifics Tutorial

Other topics

Topic 16 - Emacs
«Goto Workshop»
«Goto Workshop»

Topics covered

  1. Itemsets
«Goto Workshop»
«Goto Workshop»

Topic 19 - Git and version control
«Goto Tutorial»

Topics covered

  1. ItemsetsGit
«Goto Tutorial»