Skip to content
Prev 2132 / 5636 Next

[R-meta] "Categorical" moderator varying within and between studies

I'm not sure what produced that error and I cannot reproduce it. It may
have to do something with the version of dplyr. Here's an alternative way
to recode the Scoring variable, which might be less prone to versioning
differences:

library(dplyr)
library(fastDummies)
library(robumeta)

data("oswald2013")

oswald_centered <-
  oswald2013 %>%

  # make dummy variables
  mutate(
    Scoring = factor(Scoring,
                     levels = c("Absolute", "Difference Score", "Relative
Rating"),
                     labels = c("Absolute", "Difference", "Relative"))
  ) %>%
  dummy_columns(select_columns = "Scoring") %>%

  # centering by study
  group_by(Study) %>%
  mutate_at(vars(starts_with("Scoring_")),
            list(wthn = ~ . - mean(.), btw = ~ mean(.))) %>%

  # calculate Fisher Z and variance
  mutate(
    Z = atanh(R),
    V = 1 / (N - 3)
  )


# Use the predictors in a meta-regression model
# with Scoring = Absolute as the omitted category

robu(Z ~ Scoring_Difference_wthn + Scoring_Relative_wthn +
       Scoring_Difference_btw + Scoring_Relative_btw,
     data = oswald_centered, studynum = Study, var.eff.size = V)
On Tue, Jun 2, 2020 at 10:20 PM Simon Harmel <sim.harmel at gmail.com> wrote: