Back to Browse

Regression models in R step by step

91 views
Oct 4, 2025
7:54

In this video, we're running a basic regression model in R (or Rstudio) step by step. We begin by opening R or Rstudio, making sure the working directory is set correctly. You can download the datafile from OSF here: https://osf.io/jgd4b. If you want to follow along the code, you can also download it from OSF: https://osf.io/c3jvm. I created these data purely for illustrative reasons. The code used in the video starts on line 11. Once everything is in place, we look at three ways to run a regression model. Frequentists will use the built-in lm() command, while rstanarm and MCMCpack offer very easy Bayesian options. For the Bayesian approaches, we need to install packages, and not forget the library() command. Three ways to run your regression models in R, step by step. 00:00 Introduction 00:11 Open data 00:40 Working directory 02:56 Looking at data 03:51 Regression model 04:18 Frequentist lm() 05:25 Bayesian 05:33 rstanarm 06:59 MCMCpack

Download

0 formats

No download links available.

Regression models in R step by step | NatokHD