Class 10 : Project Plan and Interaction Effects and GLM Why Not?

Announcements

  • Changes to Agenda?

  • No Brain Exam..an Extra Lab for the Points? (And When???!)

Agenda?

  1. Final Project Time
  2. Understanding and Interpreting Interaction Effects
  3. Presentation(s)
  4. GLM (Preview) & Lab

Priority 1 : Project Time

  1. Find your name-tag and say hello. Do y’all know each other well?! Go bears.
  2. Review your project so far. What did you submit for the lab assignment?
  3. What are your next steps for the project?
  4. How would you fill out these pre-registration questions that you will need to submit for Milestone 2. Here are some tips on how to answer these questions.
    1. Have any data been collected for this study already?

    2. What’s the main question being asked or hypothesis being tested in this study?

    3. Describe the key dependent variable(s) specifying how they will be measured.

    4. Are you doing an experiment or observational (“correlational”) study?

      1. Experiment : How many and which conditions will participants be assigned to?

      2. Observational : What are some of the other key variables you will include in your study, and how will they be measured?

    5. Specify exactly which analyses you will conduct to examine the main question/hypothesis.

    6. Describe exactly how outliers will be defined and handled, and your precise rule(s) for excluding observations.

    7. How many observations will be collected or what will determine sample size?
      No need to justify decision, but be precise about exactly how the number will be determined.

  5. What questions do you have / obstacles are you running into?

Priority 2 : Understanding and Interpreting Interaction Effects

FRANTZ FANON READING.

  1. What did you think about the reading???

  2. What is his main point?

  3. Have you observed this in the wild / our modern society?

  4. How would or might you test this idea with data, as a modern psychologist would???

  5. Any other questions / ideas / comments?

SEE PROFESSOR HANDOUT.

and then….

Check-In : Interpreting Interaction Effects

h <- read.csv("~/Dropbox/!GRADSTATS/Datasets/World Happiness Report - 2024/World-happiness-report-2024.csv", stringsAsFactors = T)
library(ggplot2)
library(jtools)

## Some data cleaning.
h$GDPcat <- ifelse(scale(h$Log.GDP.per.capita) > sd(h$Log.GDP.per.capita, na.rm = T), "High GDP", "Low GDP")
h$GDPcat <- as.factor(h$GDPcat)
plot(h$GDPcat)

ggplot(data = subset(h, !is.na(h$GDPcat)), aes(x = scale(Ladder.score), y = scale(Social.support), color = GDPcat)) + 
  geom_point(alpha = .5, position = "jitter") +
  geom_smooth(method = "lm") + labs(title = "Check-In Graph") + ylab("Social Support") + xlab("Happiness (Ladder Score)") +
  theme_apa()
`geom_smooth()` using formula = 'y ~ x'

Interaction Effect : social support = .08 + .25GDP + .60 Ladder - .10 * (GDP * Ladder) BLUE LINE : social support = .08 + .25-1 + .60 Ladder - .10 * (-1 * Ladder) = -.17 + .7 * Ladder RED LINE : = .08 + .251 + .60 Ladder - .10 * (1 * Ladder) = .32 + .5 * Ladder

mod1 <- lm(scale(Social.support) ~ scale(Log.GDP.per.capita), data = h)
mod2 <- lm(scale(Social.support) ~ scale(Ladder.score), data = h)
mod3 <- lm(scale(Social.support) ~ scale(Log.GDP.per.capita) + scale(Ladder.score), data = h)
mod4 <- lm(scale(Social.support) ~ scale(Ladder.score) * scale(Log.GDP.per.capita), data = h)
export_summs(mod1, mod2, mod3, mod4)
Model 1Model 2Model 3Model 4
(Intercept)0.00    -0.00    -0.00    0.08    
(0.06)   (0.05)   (0.05)   (0.06)   
scale(Log.GDP.per.capita)0.73 ***       0.25 ** 0.25 ** 
(0.06)          (0.07)   (0.07)   
scale(Ladder.score)       0.81 ***0.62 ***0.60 ***
       (0.05)   (0.07)   (0.07)   
scale(Ladder.score):scale(Log.GDP.per.capita)                     -0.10 *  
                     (0.05)   
N140       140       140       140       
R20.53    0.66    0.69    0.70    
*** p < 0.001; ** p < 0.01; * p < 0.05.

Priority 3 : BREAK TIME

Priority 4 : Presentation(s)

Priority 5 : GLM Overview

Linear Model Generalized Linear Model (Logistic Regression)