learnr::run_tutorial(
name = "LinearRegression1",
package = "DataScienceExercises",
shiny_args=list("launch.browser"=TRUE))🗓️ Session 10: Linear models in R
This session focuses on the practical implementation of linear regression models and on how to conduct the most common tasks associated with designing and implementing experiments in R.
This way it complements the more theoretical lectures. More precisely, we focus on the following topics:
- Implement simple and multiple linear regression in R
- Calculate and interpret \(R^2\) manually and using
Rfunctions - Understand and demonstrate omitted variable bias
- Perform data transformations to linearize relationships
- Create effective visualizations using
geom_smooth() - Conduct basic model diagnostics
- Implement a power analysis in R
👨🏫 Lecture Slides
There are no slides for this lecture. The relevant information is given through the corresponding lecture and the mandatory readings.
📚 Mandatory Reading
- Linear Regression in R on Method and Inquiry (Gräbner-Radkowitsch 2026b)
- Experiments in R on Method and Inquiry (Gräbner-Radkowitsch 2026a)
Further Reading
In-class exercises
✍️ Coursework
- Complete the in-class exercises at home
- Do the exercises
LinearRegression1andLinearRegression2from theDataScienceExercisespackage
TipQuick code for starting the exercises I
TipQuick code for starting the exercises II
learnr::run_tutorial(
name = "LinearRegression2",
package = "DataScienceExercises",
shiny_args=list("launch.browser"=TRUE))References
Gräbner-Radkowitsch, C. (2026a) “Experiments in R” C. Gräbner-Radkowitsch (ed.), Method and Inquiry, available at https://euf-methodology-hub.netlify.app/resources/experiments-in-r.
Gräbner-Radkowitsch, C. (2026b) “Linear Regression in R” C. Gräbner-Radkowitsch (ed.), Method and Inquiry, available at https://euf-methodology-hub.netlify.app/resources/linear-regression-r.
Ismay, C. and Kim, A. Y.-S. (2020) Statistical inference via data science: A ModernDive, into R and the tidyverse, Boca Raton: CRC Press, Taylor and Francis Group, available at https://moderndive.com/index.html.