Lab 4

BSTA 512/612

Due: March 14, 2024 at 11pm
Author

Your name here!!

Published

March 14, 2024

Modified

March 15, 2024

1 Directions

Please turn in your .html file on Sakai. Please let me know if you greatly prefer to submit a physical copy.

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

Caution

This is the instructions file. The link above will take you to the editing file where you can add your work and turn it in!! Please do not remove anything from the editing file!!

1.1 Purpose

The main purpose of this lab is to perform model selection, identify one or more potential final models, and start our interpretation of our main relationship.

1.2 Grading

This lab is graded out of 12 points. Nicky will use the following rubric to assign grades.

1.2.1 Rubric

4 points 3 points 2 points 1 point 0 points
Formatting Lab submitted on Sakai with .html file. Answers are written in complete sentences with no major grammatical nor spelling errors. With little editing, the answer can be incorporated into the project report. Lab submitted on Sakai with .html file. Answers are written in complete sentences with grammatical or spelling errors. With editing, the answer can be incorporated into the project report. Lab submitted on Sakai with .html file. Answers are written in complete sentences with major grammatical or spelling errors. With major editing, the answer can be incorporated into the project report. Lab submitted on Sakai with .html file. Answers are bulletted or do not use complete sentences. Lab not submitted on Sakai with .html file.
Code/Work All tasks are directly followed or answered. This includes all the needed code, in code chunks, with the requested output. All tasks are directly followed or answered. This includes all the needed code, in code chunks, with the requested output. In a few tasks, the code syntax or output is not quite right. Most tasks are directly followed or answered. This includes all the needed code, in code chunks, with the requested output. Some tasks are directly followed or answered.This includes all the needed code, in code chunks, with the requested output. In a few tasks, the code syntax or output is not quite right. More than a quarter of the tasks are not completed properly.
Reasoning* Answers demonstrate understanding of research context and investigation of the data. Answers are thoughtful and can be easily integrated into the final report. Answers demonstrate understanding of research context and investigation of the data. Answers are thoughtful, but lack the clarity needed to easily integrate into the final report. Answers demonstrate some understanding of research context and investigation of the data. Answers are fairly thoughtful, but lack connection to the research. Answers demonstrate some understanding of research context and investigation of the data. Answers seem rushed and with minimal thought. Answers lack understanding of research context and investigation of the data. Answers seem rushed and without thought.

*Applies to questions with reasoning

2 Lab activities

Before starting this lab, you should go back to Lab 2, save a new .rda file that contains all the new variables from that Lab. Then you can load it here!

2.1 Restate your research question

Task

Please restate your research question below using the provided format. It’s repetitive, but it helps me contextualize my feedback as I look through your lab.

2.2 Step 1: Simple linear regressions / analysis

Tasks
  1. Run a simple linear regression model for each covariate against the IAT score (outcome).
  2. Display results from the test if each covariate explains enough variation of the outcome. This may be from three options in the instructions: summary()/anova() only, lapply(), or sapply()

Interpretation of the results will be in the next step.

2.3 Step 2: Preliminary variable selection

Tasks
  1. Decide which covariates will be included in the initial model and list them.
  2. Run the initial model and display the regression table.

No need to write out the model, but you may in addition to the list.

2.4 Step 3: Assess change in coefficient

Tasks

Remove variables from the initial model based on your common sense, change in coefficient, and/or p-values of the F-tests.

You do NOT need to show all your work here. You just need to include:

  1. A brief explanation of what variables were dropped and why (a sentence per variable), and
  2. An example of your process with one variable is enough (including code that you ran)

2.5 Step 4: Assess scale for continuous variables

Tasks

No tasks here! If you want to try out what I did above, you can!

2.6 Step 5: Check for interactions

Tasks

Using your discussion in Lab 3 and the results from the F-test on interactions:

  1. Create a list of the interactions that you will include in your model.
  2. Run the preliminary final model that includes the main effects and interactions.

2.7 Step 6: Assess model fit

Tasks

Optional: Create a table that displays some fo the model fit statistics to compare preliminary final models.

2.8 Create a forest plot of your coefficient estimates

Tasks

Create a forest plot to visualize the coefficient estimates.