PSYC 7804
Regression With Lab

Slides
Click to access Lab presentations. To navigate slides, use left/right arrow keys (on laptop) or swipe left/right (on tablet). The slides are created with the quarto extension of RStudio and use the revealjs framework.
Code
Click to download raw R code that is used in the Lab slides. The code is included in a .Rmd file that is divided according to the title of each Lab slide.
Activity
Click to download Lab activity with practice questions and solutions as a .Rmd file. A Lab activity presents questions of varying difficulty related to the respective Lab.
Descriptive Statistics and Plots This Lab goes over how to import data into R, compute some descriptive statistics, and the logic and process behind creating plots with ggplot. An in depth-explanation of QQplots is also included in the last slides. One-Predictor Regression This Lab discusses how to interpret one-predictor regression output, how to use regression to make predictions, what residuals are, and how to run a standardized regression in R. The appendix touches upon the meaning of a regression model and the root of regression assumptions. Significance Tests and Reporting Results This Lab goes over the significance-testing of regression coefficients, as well as the meaning of p-values, and reporting regression results. This Lab also includes a custom function to create APA style regression tables. Introduction To Two-Predictor Regression This Lab introduces multiple regression, contrasts one-predictor and multiple regression, includes interactive 3D visualization of regression planes, and goes over R2 and the meaning of the term variance explained. Added Variable Plots and Bootstrapping This lab introduces added variable plots as a way of visualizing partial regression coefficients. The idea of bootstrapping and its applications in the context of linear regression are also discussed. For learning purposes, this Lab also includes raw code that details the steps to create added variable plots, as well as bootstrapped confidence intervals for R2. Semi-partial, Partial-correlations, and Model Comparison This Lab introduces semi-partials and partial-correlations, and contrasts them with correlation. This lab also discusses model comparison with hierarchical regression and information criteria methods such as AIC and BIC. Multicollinearity, Dominance Analysis, and Power This Lab touches upon multicollinearity in linear regression and its consequences. Dominance analysis is also discussed as a method to evaluate relative importance of predictors in a regression. Power in regression and criticisms of practices related to power are discussed. Quadratic regression and non-linear alternatives This Lab goes over quadratic regression and detailed interpretations of its regression coefficients. This Lab also includes alternative methods such as piece-wise regression and splines. Interactions Between Continuous Variables This Lab goes over interaction effects (AKA moderation) between continuous variables. This Lab includes interpretation of interaction effects, 3D interactive representations, simple slopes interpretations and visualizations, and Johnson-Neyman plots. Categorical Predictors This Lab introduces the use of categorical predictors in linear regression. Different coding schemes for categorical predictors such as dummy coding and contrast coding are described. The equivalence of regression with categorical predictors and t-tests and ANOVAs is also discussed. Interactions with Categorical Predictors This lab introduces Interactions involving categorical predicotrs. Methods for probing interactions between categorical and continuous predictors are discussed. Mediation Analysis This lab introduces mediation analysis with path models using lavaan. Aside from simple mediation, examples of parallel mediation and moderated mediation are also shown. Missing Data This lab presents a short introduction to issues related to missing data. Missing data mechanisms, as well as consequences of missing data mishandling are discussed (e.g., bias of results). Full information maximum likelihood (FIML) is introduced as a way of handling missing data. More advanced missing data methods are briefly mentioned. Regression Diagnostics This lab discusses leverage, distance, and influence, three properties of individual data points that may impact regression results and conclusions. The regression diagnostics discussed are: hat values, studentized Residuals, DFFITS, Cook’s D, COVRATIO, and DFBETAS. Influence of outliers on regression results is also discussed.