Linear Models with R
Emphasis on 2-IV models: Basics of Multiple Regression
Linear Modeling, in it’s most rudimentary form is also termed multiple regression. This document provides a template for execution of most of the basic analyses associated with this methodology. It is intended for students of the APSY510/511 introductory statistics sequence at the University at Albany, but can be a standalone document for others learning to use R for data analysis. The level of the document is targeted to an audience of researchers in training who are simultaneously learning linear modeling/regression theory and R programming. Some introduction to regression modeling with the
lm function previously had been covered for simple regression and can be found in an accompanying document. The current document extends that work to a model with two IVs as an extensive illustration and then briefly covers models with more than two IVs. The document emphasizes models where all variables are numeric/quantitative. Categorical IVs are covered in later documents, although one brief illustration is included in this document. Some extension to models with more than two IVs is also included in the “extensions” chapter. Using the bookdown suite of tools permits organization of the document into chapters.
This book/monograph uses the bookdown package (Xie, 2020a) for R (R Core Team, 2020), which was built on top of rmarkdown (Allaire et al., 2020) and knitr (Xie, 2015). RStudio (RStudio Team, 2015) was used for all writing and programming.