Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch 7 #4

Open
ASKurz opened this issue Mar 9, 2022 · 1 comment
Open

Ch 7 #4

ASKurz opened this issue Mar 9, 2022 · 1 comment

Comments

@ASKurz
Copy link
Owner

ASKurz commented Mar 9, 2022

  • Add a basic line plot of the opposites_pp data at the top of the chapter, something like
opposites_pp %>% 
  ggplot(aes(x = time, y = opp, group = id)) +
  geom_line(size = 1/4, alpha = 1/4)
  • Somewhere toward the end of the chapter, explicitly mention how the alternatives to the standard multilevel model of change do not have id-specific equations (what frequentists would call empirical Bayes).
@ASKurz
Copy link
Owner Author

ASKurz commented Mar 9, 2022

Also, I don't know that S&W made this point, but it is possible to combine their various alternative error structures with random effects. Hoffman (2015) perhaps does a better job at this in Chapter 4, Section 3 (p. 131). You might show how to, say, fit a random intercept model with an AR1 like

fit7.5b <-
  brm(data = opposites_pp,
      family = gaussian,
      opp ~ 0 + Intercept + time + ccog + time:ccog + ar(gr = id, cov = TRUE) + (1 + time | id),
      iter = 2000, warmup = 1000, chains = 4, cores = 4,
      seed = 7,
      control = list(adapt_delta = .999,
                     max_treedepth = 12))

Note my use of control. Even with this setting, the chains still aren't mixing well. You may have to think carefully about regularizing priors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant