Lab 4 Instructions

BSTA 513/613

Author

Nicky Wakim

Modified

May 15, 2026

Caution

This lab IS ready to be worked on! (Nicky 5/14/26)

Note

This lab looks short, but there is a lot of work here!!

1 Directions

You can download the .qmd file for this lab here.

The above link will take you to your editing file. Please do not remove anything from this editing file!! You will only add your code and work to this file.

1.1 Purpose

The purpose of this lab is to fit a multiple logistic regression model and practice how we would interpret our results for this study.

2 Lab activities

Note

I have left it up to you to load the needed packages for this lab.

2.1 Restate project type

ImportantTask

Restate your project type: LASSO or purposeful model selection.

Purposeful model selection only: Please restate your research question below using the provided format (1 sentence). You can change the wording if you’d like, but please make sure it is still clear. It’s repetitive, but it helps me contextualize my feedback as I look through your lab.

Project type: LASSO or purposeful model selection

Purposeful model selection only: In this study, we will investigate the association between food insecurity and ________.

2.2 Build your model

It’s time for your decision on model building to SHINE! You will need to build a model for your outcome using LASSO or purposeful model selection (see your project type above heh). We discussed prediction modeling in Lesson 14. We discussed association modeling and purposeful model selection in BSTA 512/612, also Lesson 14.

For this activity, you may either:

  1. Use LASSO to build a model with no interactions
  2. Use Purposeful model selection to build a model with at least one interaction

I highly suggest picking the model selection strategy based on your desired learning objective. LASSO will help stretch your R coding and machine learning skills. Purposeful model selection will allow you to cement many concepts that we learned within 512/612 and 513/613.

I will not be taking you through step-by-step. Please follow my work from Lesson 14 in 513/613 (for LASSO) or from Lab 4 in 512/612 (for purposeful model selection).

ImportantTask

Build a model for your outcome:

  1. Use LASSO to build a model with no interactions
  2. Use Purposeful model selection to build a model with at least one interaction

Make sure to show your process!!

2.3 Assess your model fit

ImportantTask

Calculate the ROC-AUC of your model.

2.4 Perform model diagnostics

For purposeful model selection only. If you doing LASSO, please skip.

ImportantTask

Check your diagnostic plots and cutoffs (change in Pearson residuals, change in coefficients, etc.) to identify and investigate any influential or outlier observations. Are these observations feasible?

2.5 OPTIONAL: Interpret your results

This will be really helpful for your poster, but you can do it now or later!

Go back to Lab 3 and look at your visualizations and interpretations of ORs and/or predicted probabilities.

If you are doing purposeful model selection, you can go back to these plots and update them based on your final model.

If you are doing LASSO, you have some options for your results, discussion, and conclusion. You can focus on answering “what are the most important predictors of food insecurity?” or you can extend this to “what are the most important predictors of food insecurity and how do they relate to food insecurity?” If you want to do the latter, you can use your LASSO model and follow the steps in Lesson 14 to get ORs and predicted probabilities for your LASSO model.

ImportantOPTIONAL Task

OPTIONAL: Update your visualizations and interpretations from Lab 3 based on your final model.