[R-meta] FW: Multiple comparisons / Tukey test multilevel meta analysis
Viechtbauer Wolfgang (SP)
wolfgang.viechtbauer at maastrichtuniversity.nl
Tue Oct 17 16:06:15 CEST 2017
The two extra zeros are there in the example because the model includes two more coefficients, one for 'year' and one for 'ablat'. But these are obviously not part of your model, so yes, you should delete them.
And yes, with 15 levels, there are 15*14/2 = 105 pairwise contrasts and that is indeed a lot. If sensible, you might consider collapsing some levels (*before looking at the results!*) to reduce the number of comparisons.
Best,
Wolfgang
-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces at r-project.org] On Behalf Of Kranzbuhler, Anne
Sent: Tuesday, 17 October, 2017 15:50
To: r-sig-meta-analysis at r-project.org
Subject: [R-meta] FW: Multiple comparisons / Tukey test multilevel meta analysis
Dear Wolfgang, dear Michael,
Thanks a lot for your replies!
I got it to work now with the glht() and contrMat() commands, however leaving out the two zeros that are included in the example code on the website. Actually, I don't know what those two zeros were for but leaving them out got rid of the error that the column length of the linfct was unequal to the number of coefficients in my model.
Now I am only struggling with the adjustment of p-values. As I am testing so many contrasts (for all 15 levels), adjusting the p-values yields almost no significant results anymore. But I think this is a different problem....
The code that worked for me is:
summary(glht(mods_emos, linfct=cbind(contrMat(c("1"=1,"2"=1,"3"=1,"4"=1,"5"=1,"6"=1,"7"=1,"12"=1,"13"=1,"14"=1,"15"=1,"17"=1,"18"=1,"19"=1,"21"=1), type="Tukey"))), test=adjusted("BH"))
Thanks again and best regards,
Anne
-----Original Message-----
From: Michael Dewey [mailto:lists at dewey.myzen.co.uk]
Sent: Tuesday, October 17, 2017 2:42 PM
To: Kranzbuhler, Anne <a.kranzbuhler at uva.nl>; r-sig-meta-analysis at r-project.org
Subject: Re: [R-meta] Multiple comparisons / Tukey test multilevel meta analysis
Dear Anne
While we wait for Wolfgang to reply there are a couple of things you could try.
1 - do any of the slightly different approaches outlined in http://www.metafor-project.org/doku.php/tips:testing_factors_lincoms work?
2 - what happens if you do traceback() immediately after the error? At least then we would know where it is looking for the model.matrix (that should work on models from rma.mv as far as I can see).
Michael
On 17/10/2017 10:32, Kranzbuhler, Anne wrote:
> Hi,
>
> I am doing a multilevel meta analysis with the metafor package (I am new to all this, so please excuse me if this is a stupid question). I want to run a moderator analysis with one categorical moderator that has 15 levels. Is there any way that I could run some sort of post-hoc (Tukey) test to determine which of the levels do or do not differ?
> The output of the model is as follows (I now want to know whether the different levels of the variable "emo" differ. Trying the glht() command always produces an error - see below).
>
> Is there anyone who could help me with this?
>
> mods_emos <- rma.mv(EF_FisherZ, variance_FisherZ, W= weight_FisherZ,
> mods= ~ emo, random = list(~ 1 | Study, ~ 1 | Effectsizecount),
> data=data_neg, method='ML') summary(mods_emos, digits=3)
>
> Multivariate Meta-Analysis Model (k = 820; method: ML)
>
> logLik Deviance AIC BIC AICc
> -167.024 3189.101 368.048 448.106 368.811
>
> Variance Components:
>
> estim sqrt nlvls fixed factor
> sigma^2.1 0.038 0.195 85 no Study
> sigma^2.2 0.063 0.250 820 no Effectsizecount
>
> Test for Residual Heterogeneity:
> QE(df = 805) = 18413.355, p-val < .001
>
> Test of Moderators (coefficient(s) 2:15):
> QM(df = 14) = 35.150, p-val = 0.001
>
> Model Results:
>
> estimate se zval pval ci.lb ci.ub
> intrcpt -0.286 0.069 -4.129 <.001 -0.422 -0.150 ***
> emo2 0.036 0.125 0.292 0.770 -0.208 0.281
> emo3 0.032 0.124 0.255 0.798 -0.212 0.275
> emo4 0.273 0.120 2.282 0.023 0.039 0.508 *
> emo5 0.140 0.080 1.751 0.080 -0.017 0.297 .
> emo6 0.234 0.099 2.357 0.018 0.040 0.429 *
> emo7 0.210 0.163 1.290 0.197 -0.109 0.529
> emo12 0.364 0.105 3.461 <.001 0.158 0.571 ***
> emo13 -0.090 0.114 -0.784 0.433 -0.313 0.134
> emo14 0.032 0.112 0.289 0.773 -0.187 0.252
> emo15 0.125 0.124 1.012 0.312 -0.117 0.368
> emo17 0.148 0.142 1.044 0.297 -0.130 0.425
> emo18 -0.101 0.128 -0.788 0.431 -0.353 0.150
> emo19 0.104 0.141 0.741 0.458 -0.172 0.381
> emo21 0.260 0.189 1.372 0.170 -0.111 0.631
>
> glht(mods_emos, linfct = mcp(emo = "Tukey"))
>
> Error in formula.default(object, env = baseenv()) : invalid formula
> Error in factor_contrasts(model) :
> no 'model.frame' method for 'model' found!
More information about the R-sig-meta-analysis
mailing list