Regression Analysis in R: Adapting to Varied Data Types#
Course Description#
Regression analysis is a fundamental statistical technique used to model the relationship between multiple variables. It is a very flexible tool that can handle a range of different data types (continuous, binary or categorical) and address both complex and simple research questions. In this hands-on workshop you will build on your understanding of simple linear regression and learn how to fit a broader range of regression models with R including logistic regression.
While it is delivered as a stand-alone session, it is designed as a part of a series of Regression with R workshops where the content develops the ideas further to give you a comprehensive understanding of how regression can be used to address a broad range of questions.
The complete series includes:
Introduction to Regression with R
Regression Analysis in R: Adapting to Varied Data Types
Mixed Effects Regression with R
Course Objectives#
Understand what a generalised linear model is
Fit logistic regression models with R
Select the appropriate regression model for either a continuous or binary outcome
Include a range of different types of predictor variables in regression models
Interpret the coefficients of a regression model
Pre-requisite Knowledge#
Learners are expected to already be familiar with the basics of R, such as how to load a dataset from a local file and manipulate variables.
We also assume that you are comfortable with fitting simple linear regression models in R and interpreting the output of these. If not, we recommend you consult the previous course in this series - Introduction to Regression with R.
The interactive network visualisation below displays the prerequisite structure for this course within the training program. Each node represents a course that you may need to complete beforehand, and the arrows show the recommended order in which to take them, leading up to your selected course. You can click on any course node to view more information about that course. This interactive tool helps you clearly see the learning path required to access this course, making it easier to plan your progress with the Coding for Reproducible Research Training (CfRR) initiative.
Pre-Reqs Subnetwork
Sign-up#
To check for upcoming course dates and to register, please visit the Workshop Schedule and Sign-up page.
Installation Guide#
All CfRR courses require attendees to use their own computer/laptop to follow workshop activities and take effective notes.
As this course extends upon Introduction to R, the installation instructions for the base R elements are the same, available Intro To R.
Alongside having R itself, three packages are needed for this workshop. The first two (devtools & learnr) are available from CRAN. The third is a package we have developed with the course materials and is available from GitHub (cfrrRTutorials).
This code will install these three packages.
install.packages("devtools")
install.packages("learnr")
library(devtools)
devtools::install_github("coding-for-reproducible-research/cfrrRtutorials")
If you encounter any difficulties with installation, please reach out.
Self Study Material Link#
The self-study material for this course is available as a tutorial through the cfrrRtutorials R package installed as part of the set up for this workshop. To launch the “Regression Analysis in R: Adapting to Varied Data Types” tutorial in Rstudio you can run:
learnr::run_tutorial("Regression Analysis in R: Adapting to Varied Data Types", "cfrrRtutorials")
When ready the tutorial may launch in a new window, or (more likely) there will be some output in red in the Jobs console that says something like:
Output created: Regression-Analysis-in-R:-Adapting-to-Varied-Data-Types.html
Listening on http://127.0.0.1:38555
+------------------------------------------------------------------------+
<U+2713> Open the tutorial in your browser: http://127.0.0.1:38555
! Stop or cancel this job to stop running the tutorial
+------------------------------------------------------------------------+
If the tutorial does not automatically launch in a new window, copy the web address in this case (http://127.0.0.1:38555) into a web browser of your choice, such as Chrome.
You can then start the workshop in this document. You can navigate through the sections using the menu on the side. Please note that the data required for the examples and exercises is preloaded within each interactive document, so the commands/exercises only work within it. They won’t work with the Rstudio console. When you come to apply what you have learned on your own datasets, you will need to ensure your data is loaded and edit the syntax to model the relevant variables.
Developers#
This workshop was developed by Eilis Hannon.
License Info#
The file ../individual_modules/regression_analysis_with_R/LICENSE.txt was not found.