I'm performing a meta-analysis of studies that compared treatment and control groups from pre-test to post-test using means of count data. Other authors have performed similar analyses using raw counts (Welsh & Farrington, 2008, Farington & Welsh (2013), and Jones (2005)). What I would like to do is drop variables into the model one-by-one to test whether they significantly moderate the treatment effects. I have created a glm log reg that models the random effects using Jones' (2005, p37) code:
id <- c(1:10)
a <- c(0.28, 2.26, 0.44, 1.22, 1.80, 1.45, 1.09, 2.00, 2.27, 2.11)
b <- c(0.15, 1.02, 0.16, 0.51, 0.76, 0.51, 0.13, 0.59, 0.57, 0.79)
c <- c(0.30, 2.21, 0.21, 1.05, 1.78, 1.26, 0.84, 1.86, 2.17, 2.58)
d <- c(0.42, 2.27, 0.28, 0.59, 0.91, 0.54, 0.51, 0.73, 0.90, 0.85)
mod1 <- c("Yes", "Yes", "No", "Yes", "No", "Yes", "Yes", "Yes", "No", "Yes")
mod2 <- c(2010, 2013, 2010, 2017, 2001, 2009, 2012, 2006, 2015, 2015)
bef <- c(a,c)
aft <- c(b,d)
n <- bef+aft
treat <- scan(,"")
1: E
2: C
treat<- gl(2,10,20,labels = treat)
study<- gl(10,1,20,labels = id)
model_effect_sizes <- glm(bef/n ~ treat + study,family=quasibinomial, weights=n)
summary(model_effect_sizes)
I'd like to add moderator variables into the model one by one but am unsure on how to code them. I have tried simply doubling the variable as follows so that it is the right length to be include in the model, but its coefficients are NAs. I have read here that its likely due to multicollinearity:
mod1a <- as.factor(c(mod1, mod1))
moderator1a<-glm(bef/n ~ treat + study + mod1a,family=quasibinomial, weights=n)
summary(moderator1a)
I've also tried coding the second half of the vector with 0s and including the variable as a numerical vector which produces coefficients for the moderator:
mod1b <- c(2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 0,0,0,0,0,0,0,0,0,0)
moderator1b<-glm(bef/n ~ treat + study + mod1b,family=quasibinomial, weights=n)
summary(moderator1b)
But I'm uncertain if this produces reliable coefficients, and would also prefer to be able to include mod1 as a factor. Similarly, if I try this approach with with mod2 the intercept and the treatment variable produce almost identical coefficients:
mod2a <- c(2010, 2013, 2010, 2017, 2001, 2009, 2012, 2006, 2015, 2015,0,0,0,0,0,0,0,0,0,0)
moderator2a<-glm(bef/n ~ treat + study + mod2a,family=quasibinomial, weights=n)
summary(moderator2a)
So the question comes down to: how can these moderators be included in this model to avoid singularity and to keep their original structure? Thanks for your help,
Jones, H. E. (2005). Measuring Effect Size in Area-Based Crime Prevention Research. Statistical Laboratory. Cambridge, UK, Cambridge University. Masters of Philosophy.