[R-meta] Model with intercept gives 0 heterogeneity but without intercept is ok

Viechtbauer, Wolfgang (SP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Mon Aug 30 18:26:03 CEST 2021


Dear Luke,

If X is a continuous moderator, removing the intercept forces the line to go through the origin. That is very rarely a sensible thing to do. See also:

https://www.metafor-project.org/doku.php/tips:models_with_or_without_intercept

Best,
Wolfgang

>-----Original Message-----
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On
>Behalf Of Luke Martinez
>Sent: Monday, 30 August, 2021 18:02
>To: R meta
>Subject: [R-meta] Model with intercept gives 0 heterogeneity but without intercept
>is ok
>
>Dear Colleagues.
>
>I fitted two exact same models except that for one I included the intercept
>(Model 1) in the model, for the other, I didn't (Model 2).
>
>I wonder why for Model 1 the estimate of between-study heterogeneity is "0"
>but for Model 2 that estimate is not "0"?
>
>Thank you very much,
>Luke
>
>set.seed(132)
>data <- expand.grid(study = 1:60, outcome = rep(1:2,2))
>data$X <- rnorm(nrow(data))
>e <- rnorm(nrow(data))
>data$yi <- .8+.6*data$X + e
>data$vi <- runif(nrow(data))
>
>Model1 <- rma.mv(yi ~ 1 + X, vi, random = ~ 1 | study/outcome, data = dat)
>
>                       estim    sqrt  nlvls  fixed         factor
>sigma^2.1  0.0000  0.0001     60     no          study
>sigma^2.2  0.4707  0.6861    120     no  study/outcome
>
>
>Model2 <- rma.mv(yi ~ 0 + X, vi, random = ~ 1 | study/outcome, data = dat)
>
>                    estim    sqrt  nlvls  fixed         factor
>sigma^2.1  0.5634  0.7506     60     no          study
>sigma^2.2  0.4878  0.6984    120     no  study/outcome



More information about the R-sig-meta-analysis mailing list