Back to schedule


Example Data Set: Kashy

Outcome:

  • ASATISF Satisfaction

Predictor Variables:

  • TIME: time in days (there are 14 days with 0 = study midpoint).
  • GENDER: Gender effects coded (Women = -1 and Men = 1).
  • GenderS: A string variable that labels women “Woman” and men “Man”.

Moderators:

  • CAAvoid, CPAvoid: Grand mean centered attachment avoidance (Actor and Partner—a mixed moderator)

First, read in the new dataset. It’s already in the person-period pairwise structure.

library(dyadr)
library(dplyr)
library(nlme)
library(ggplot2)

kashy_ppp <- read.csv("kashy.csv")
View(kashy_ppp)

Individual Growth Curve Modeling

First, for illustration purposes, we want to run a growth curve model for men only. We can use the Kashy data but select only men with this syntax:

kashy_men <- kashy_ppp %>%
  filter(GENDER == 1)

Spaghetti Plot

Spaghetti plot shows different slopes for different folks!

kashy_men_small <- kashy_men %>%
  filter(DYADID >= 1 & DYADID <= 20)

ggplot(kashy_men_small, aes(TIME, ASATISF, 
                            group = as.factor(DYADID),
                            color = as.factor(DYADID))) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE)