Clustering & Classification in R
Data rarely comes neatly labelled or structured, yet patterns can still exist even when they are not immediately obvious. Clustering methods help researchers uncover that structure by grouping similar observations, while classification provides a framework for understanding and predicting known groups.
This six-part series introduces several of the main ways that similarity and group structure can be defined. Participants will work with hierarchical, centroid-based, fuzzy, distribution-based, graph-based, and density-based models. Emphasis is placed on understanding how each method forms groups, recognizing the assumptions behind the method, evaluating the resulting clusters, and choosing an approach that makes sense for the data rather than simply using the most familiar algorithm.
All workshops will use R and RStudio, so some experience with R or another programming language is encouraged but not required. See R Fundamentals for Data Analysis for an introduction to R and RStudio. Attendees without prior experience are encouraged to review this content. No prior knowledge of clustering or classification is required, and each workshop will introduce the background needed for that session.
-
Part 1: Hierarchical Models
Description
Hierarchical clustering builds groups step by step, making it possible to explore structure without selecting the number of clusters in advance. Participants will learn how distance measures and linkage methods affect the resulting hierarchy, create and interpret dendrograms, and use common diagnostics to decide where the hierarchy should be divided.
-
Part 2: Centroid-Based Models
Description
Centroid-based methods assign observations to groups represented by a central point. This session introduces methods such as k-means and k-medoids, including how to select the number of clusters, assess the stability and quality of a solution, and recognize when a centroid-based model may not suit the shape or structure of the data.
-
Part 3: Fuzzy Models
Description
Not every observation belongs cleanly to a single group. Fuzzy clustering replaces hard assignments with degrees of membership, allowing uncertainty and overlap between clusters to be represented directly. Participants will fit fuzzy clustering models in R, interpret membership values, and compare fuzzy and hard cluster solutions.
-
Part 4: Distribution-Based Models
Description
Distribution-based clustering treats the data as arising from a mixture of underlying probability distributions. Participants will be introduced to finite mixture models and model-based clustering, learn how these models describe clusters with different shapes and variability, and use statistical criteria and uncertainty estimates to evaluate a fitted solution.
-
Part 5: Graph-Based Models
Description
Graph-based methods represent observations as a network of connections, allowing clusters to emerge from patterns of local similarity. This session introduces graph construction and spectral clustering, with attention to how the similarity measure and graph structure influence the final groups. Participants will apply these methods and interpret the resulting cluster structure in R.
-
Part 6: Density-Based Models
Description
Density-based clustering finds groups as regions where observations are concentrated and treats isolated observations as potential noise. Participants will use methods such as DBSCAN to identify clusters with irregular shapes, examine the effect of tuning parameters, and determine when a density-based approach is more appropriate than methods built around cluster centres.
</section
Dimensionality Reduction in R
Large datasets often contain many variables, but more variables do not always mean more information. Strong relationships, redundant measurements, and noise can make patterns harder to see and models harder to interpret. Dimensionality reduction provides a collection of tools for representing complex data with fewer dimensions while retaining the information that matters most.
This six-part series introduces both linear and nonlinear approaches to dimensionality reduction. Participants will work with methods designed for visualization, feature extraction, latent structure, supervised outcomes, and mixed-type data. Emphasis is placed on understanding what each reduced dimension represents, what information may be lost, and how the purpose and structure of the analysis should guide the choice of method.
All workshops will use R and RStudio, so some experience with R or another programming language is encouraged but not required. See R Fundamentals for Data Analysis for an introduction to R and RStudio. Attendees without prior experience are encouraged to review this content. No prior knowledge of dimensionality reduction is required, and each workshop will introduce the background needed for that session.
-
Part 1: Linear Methods I – PCA and ICA
Description
Principal component analysis and independent component analysis both create new variables from existing ones, but they look for different kinds of structure. Participants will learn how the methods differ, fit both in R, determine how many components to retain, and interpret the resulting components, loadings, and visualizations.
-
Part 2: Linear Methods II – Factor Analyzers
Description
Factor analysis explains relationships among observed variables through a smaller number of unobserved factors. This session introduces the underlying model, its distinction from principal component analysis, and practical decisions such as selecting the number of factors and choosing a rotation. Participants will interpret factor loadings, communalities, and factor scores in R.
-
Part 3: Nonlinear Methods I – T-SNE and UMAP
Description
Some patterns cannot be represented well by a straight line or a linear combination of variables. This session introduces t-SNE and UMAP for constructing low-dimensional representations of nonlinear data. Participants will create and compare embeddings, explore the effect of tuning parameters, and learn what conclusions these popular visualizations can and cannot support.
-
Part 4: Nonlinear Methods II – MDS and Kernel PCA
Description
Multidimensional scaling and kernel principal component analysis provide two different ways to uncover structure beyond ordinary linear projections. Participants will learn how distances and kernels define the resulting representation, implement both approaches in R, and evaluate how well the lower-dimensional space preserves meaningful relationships in the original data.
-
Part 5: Supervised Methods – LDA and PLS
Description
Unlike unsupervised methods, supervised dimensionality reduction uses information about an outcome when constructing a smaller set of features. This session introduces linear discriminant analysis and partial least squares, with attention to how the two methods use outcome information differently. Participants will fit, visualize, and evaluate these models in R for classification or prediction.
-
Part 6: FAMD for Mixed-type Data
Description
Many real datasets contain both numeric and categorical variables, making standard principal component analysis an incomplete solution. Factor analysis of mixed data provides a joint representation that balances information across variable types. Participants will apply FAMD in R, interpret the reduced dimensions and variable contributions, and use the resulting representation to explore heterogeneous data.
Linear Regression in R
Linear regression is often one of the first statistical models researchers encounter, but using it well involves much more than drawing a straight line. Researchers must understand what the model is estimating, whether its assumptions are reasonable, and how the results relate to the original research question.
This series introduces linear regression as a framework for studying relationships, testing hypotheses, and making predictions. Participants will progress from simple and multiple linear regression to model interpretation, prediction, interaction effects, hierarchical models, and penalized regression. Emphasis is placed on understanding model assumptions, evaluating model fit and predictive performance, and communicating results without overstating what the model can establish.
All workshops will use R and RStudio, so some experience with R or another programming language is encouraged but not required. See the R Fundamentals for Data Analysis for an introduction to R and RStudio. Attendees without prior experience are encouraged to review this content. No prior knowledge of linear regression is required, and each workshop will introduce the background needed for that session.
-
Part 1: Intro to Linear Regression
Description
Linear regression provides a direct way to describe how a continuous outcome changes with an explanatory variable. Participants will fit simple linear regression models in R, interpret the slope and intercept, visualize fitted relationships, and examine the main assumptions that determine whether the model can be trusted.
workshop page
-
Part 2: Multiple Linear Regression
Description
Research questions rarely involve only one explanatory variable. This session extends the linear model to include several predictors and explores how the interpretation of a coefficient changes once other variables are included. Participants will fit and compare multiple regression models, work with numeric and categorical predictors, and examine collinearity and confounding.
workshop page
-
Part 3: Interpreting Results
Description
Regression output contains a great deal of information, but statistical significance alone does not tell the whole story. Participants will learn to interpret coefficients, confidence intervals, hypothesis tests, and measures of model fit in the context of a research question. The session will also discuss practical significance and how to communicate results without overstating what the model establishes.
workshop page
-
Part 4: Fitting vs. Predicting
Description
A model that describes the observed data well does not necessarily predict new observations well. This session separates explanatory modelling from prediction and introduces training and test data, out-of-sample evaluation, and common prediction metrics. Participants will also distinguish confidence intervals from prediction intervals and examine how overfitting can give a misleading impression of performance.
workshop page
-
Part 5: Interaction Terms and Hierarchical Linear Models
Description
Relationships can change across groups, settings, or levels of another variable, and observations collected within the same group may not be independent. Participants will use interaction terms to model changing effects and hierarchical linear models to account for grouped or repeated observations. Emphasis is placed on interpreting conditional effects and understanding the roles of fixed and random effects.
-
Part 6: Penalized Models
Description
Models with many or strongly related predictors can become unstable and difficult to interpret. Penalized regression controls model complexity by shrinking coefficient estimates and, in some cases, selecting variables. Participants will fit ridge, lasso, and elastic-net models in R, use cross-validation to choose the amount of penalization, and compare their predictive performance.
GLMs and GAMs in R
Linear regression is a powerful starting point, but many outcomes are not continuous and many relationships are not straight lines. Binary responses, counts, proportions, and nonlinear trends require models that can adapt to the structure of the data while remaining interpretable.
This six-part series introduces generalized linear models and generalized additive models as flexible extensions of ordinary linear regression. Participants will learn how response distributions, link functions, smooth effects, prediction, and grouped data can be incorporated into a statistical model. Emphasis is placed on selecting a model that matches the outcome, interpreting results on the correct scale, checking model adequacy, and communicating what the fitted model can support.
All workshops will use R and RStudio, so some experience with R or another programming language is encouraged but not required. See R Fundamentals for Data Analysis for an introduction to R and RStudio. Attendees without prior experience are encouraged to review this content. No prior knowledge of generalized linear or additive models is required, and each workshop will introduce the background needed for that session.
-
Part 1: Intro to Generalized Linear Models
Description
Generalized linear models extend linear regression to outcomes such as binary responses and counts. Participants will learn how the response distribution and link function define a model, fit introductory logistic and Poisson regression models in R, and recognize when an ordinary linear model is not appropriate.
-
Part 2: Interpreting Generalized Linear Models
Description
Coefficients from a generalized linear model are not always expressed on the scale researchers care about most. This session shows how to move between the link and response scales and interpret quantities such as odds ratios, rate ratios, fitted probabilities, and expected counts. Participants will also examine uncertainty, model fit, and common diagnostics.
-
Part 3: Intro to Generalized Additive Models
Description
Generalized additive models allow relationships to bend when a straight line is too restrictive. Participants will learn how smooth terms are constructed and controlled, fit additive models in R, and compare linear and nonlinear representations of the same relationship without having to specify its shape in advance.
-
Part 4: Interpreting Generalized Additive Models
Description
The flexibility of an additive model is useful only if its fitted effects are interpreted carefully. This session focuses on visualizing smooth terms, understanding their uncertainty and effective degrees of freedom, and describing nonlinear relationships in clear language. Participants will also use diagnostics to identify models that are too simple, unnecessarily complex, or poorly supported by the data.
-
Part 5: Predicting from GLMs and GAMs
Description
Predictions from generalized models depend on the outcome distribution, the link function, and the scale on which results are reported. Participants will generate predictions and uncertainty intervals from GLMs and GAMs, evaluate performance on new data, and choose measures suited to continuous, binary, or count outcomes.
-
Part 6: Generalized Linear Mixed Effects Models
Description
Binary, count, and other non-normal outcomes often arise from grouped, repeated, or multilevel data. Generalized linear mixed-effects models combine the flexibility of a generalized linear model with random effects that account for this dependence. Participants will fit these models in R, interpret fixed and random effects, and examine how the data structure influences model specification.
Survival Analysis in R
Time-to-event data (sometimes referred to as 'survival' data) are commonplace across a diverse set of disciplines including biology, engineering, medicine, economics, and the social sciences and occur whenever researchers are interested in modeling how long it takes for an event of interest (e.g., disease remission, death, or component failure) to occur. However, working with time-to-event data can be difficult for a variety of reasons including incomplete observation times prior to or after an event (often referred to as 'censored' data); skewed distributions (waiting times between events can have highly 'skewed' or uneven distributions — often 'piling' up very quickly or having long-tailed distributions); and nonconstancy of 'risk' or the likelihood of an event occurring over time.
This series introduces researchers to the approaches and programming tools needed to tackle challenges associated with time-to-event data. Participants will learn progressively more advanced frameworks—from the basics of understanding incomplete observation periods using censoring data formats and Kaplan-Meier survival curves, to accounting for nonconstant risk and skewed distributions using parametric models. Throughout, attendees will explore model diagnostics to ensure their findings are statistically valid, and implement predictive validation techniques to assess how accurately their models forecast future events. Emphasis is placed on understanding model assumptions and output, evaluating model fit, and selecting methods that align with the model assumptions.
All workshops will use R and RStudio, so some experience with R or other programming languages is encouraged but not required. See the R Fundamentals for Data Analysis for an introduction to R and RStudio. Attendees without prior experience are encouraged to review this content.
-
Part 1: Survival Data, Censoring, and Truncation
Description
Survival analysis is, at its core, about modeling risk, or the probability that an event occurs, over time. But before that risk can be modeled, the data must be structured correctly. However, time-to-event data are rarely complete: some subjects leave a study before experiencing the event of interest, and others enter observation only after time has already passed. We show why ignoring incomplete data risks biasing estimates from the very first model fit. Participants will learn how to establish a consistent 'time origin' across subjects with different start dates, define who is at risk of the event at any given point in follow-up, and represent this structure correctly in R using the Surv() function.
-
Part 2: Kaplan-Meier Estimation
Description
Once our data are structured with a clear time origin and event status, the natural next question is: what does survival look like over time? This workshop introduces the survival curve — a 'step-shaped' plot showing the estimated probability of remaining event-free at each point in follow-up. We build this curve using Kaplan-Meier estimation — an approach that typically requires no assumptions about the underlying 'shape' of risk (or in other words is non-parametric) — making it an ideal first step for describing time-to-event data before introducing more structured models later in the series.
-
Part 3: Cox Proportional Hazards Models
Description
After developing an understanding of how risk changes over time, we may want to model that risk as a function of some factors of interest. Cox proportional hazards (Cox PH) models extend the simple survival curve from Part 2 into a framework that allows us to ask not only what survival 'looks' like, but also why it differs across individuals. Rather than modeling survival probability directly, the Cox model works on the instantaneous risk of the event at a given moment (the 'hazard') and allows us to estimate how covariates (e.g., age; control or treatment status; or disease stage) change that risk. Critically, this modelling framework assumes that the relative proportion of risk between 'groups' remains the same over time — and hence is called 'proportional'. This model leaves the underlying shape of the baseline hazard unspecified, just as in the case of survival curve estimation. Cox PH models are thus referred to as semi-parametric.
-
Part 4: Model Diagnostics and Interpretation
Description
Having fit a Cox model in Part 3, the next (and most important) task is making sense of and communicating the results. In this workshop we build that skill by reading hazard ratios, confidence intervals, and coefficient tables, and translating those outputs into meaningful statements about risk. However, up to this point we have supposed that the model is appropriate for our data — an assumption that the relative risk between individuals remains constant over time. In the second half of the workshop, we introduce the tools used to test whether the 'proportionality' assumption actually holds — spoiler alert: it rarely does. We close by setting up the question the rest of the series must answer: what do we do when it doesn't?
-
Part 5: Parametric and Accelerated Failure Time Models
Description
Part 4 left us with a critical (and unresolved) question: What do we do when the proportional hazards assumption fails? One answer is to step outside the Cox framework altogether. This workshop introduces survival models, which specify the exact shape of the hazard function using a chosen probability distribution (such as Weibull or exponential). Within this framework, we will focus on Accelerated Failure Time (AFT) models. AFT asks how a variable speeds up or slows down time to the event itself. Because AFT models completely bypass the proportional hazards assumption, they offer a valid alternative when your diagnostics flag a violation.
-
Part 6: Prediction
Description
It has been asserted that the utility of any given model is best measured by how well it predicts data it has not yet seen. In this final workshop, we take this assertion seriously and ask: how well do our models predict outcomes for new individuals? We shift from describing and explaining the data used to build a model, to evaluating a model's ability to generalize beyond it. In the process we introduce two complementary ways to assess model predictions: discrimination (the model's ability to correctly rank risk among individuals) and calibration (the model's ability to accurately predict survival probabilities).
Research Data Management (RDM)
These sessions address fundamental concepts in research data management (RDM), including its relevance in the context of research, approaches to implementing effective management through documentation and file system organization, and how to use the Data Management Plan (DMP) Assistant, an online tool, to help researchers adhere to funder requirements to submit a DMP.
-
RDM Part 1: The Basics
-
RDM Part 2: Documentation
-
RDM Part 3: Data Management Plans
Introduction to the Bash shell
The command line interface can seem daunting to new users, but it is a very powerful tool that, with some foundational understanding, can be used for a number of different computational and data management tasks, for example routinizing repetetive file management activities or working with UBC's high performance computing (HPC) infrastructure. These sessions are aimed at those who have little to no experience with the command line; it introduces the Bash shell, its core functions, and the basics of navigating files and directories.
-
Introduction to the Bash shell Part 1: Navigating Files and Directories
-
Introduction to the Bash shell Part 2: Working with Files and Directories
Git and GitHub
These sessions provide an introduction to Git and GitHub, respectively a version control application and a remote Git server to facilitate file sharing and back-ups. Topics covered include automated version control and basic Git functions including initiating a Git repository, pushing to and pulling from a remote repository, managing workflows with branching, etc.
-
Introduction to GitHub Part 1
-
Introduction to GitHub Part 2
</div>
</div>