[R-meta] model selection using the glmulti
Viechtbauer, Wolfgang (SP)
wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Sat Jun 1 20:49:22 CEST 2019
Please always cc the mailing list.
The results are only contradictory in so far that two different methods are leading to different conclusions. Maybe climate becomes only relevant when other moderators are included in the model. Without the data and reproducible code, I cannot tell you what is going on.
From: shuai [mailto:zss_1994 using 163.com]
Sent: Monday, 27 May, 2019 14:53
To: Viechtbauer, Wolfgang (SP)
Subject: Re:RE: [R-meta] model selection using the glmulti
Thank you very much for your reply!
I have used the code you gave for model selection. And I got this figure:
and we can see that climate is important. (>0.8 climate include arid and humid)
But when I calculate the Qm of climate using the code as follow:
r4<-rma(yi,vi, mods=~climate, data=eff1, method="REML")
I got the result:Qm=0.0467, p=0.8289 so this result means the climate is not important?
Are the results of these two methods contradictory?
Looking forward to your reply,
At 2019-05-27 17:26:39, "Viechtbauer, Wolfgang (SP)" <wolfgang.viechtbauer using maastrichtuniversity.nl> wrote:
>The example you linked to uses a mixture of continuous and dummy variables. Factors are typically encoded as dummy variables, so as long as your factors only have two levels, it's really the same thing. Factors with more than two levels are typically encoded as a bunch of dummy variables, but we typically do not want to enter/remove individual dummy variables, but the whole factor. Fortunately, this all works like a charm with metafor + glmulti. Here is an example (year and ablat are continuous, alloc is a three-level factor):
>dat <- dat.bcg
>dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
>rma.glmulti <- function(formula, data, ...)
> rma(formula, vi, data=data, method="ML", ...)
>res <- glmulti(yi ~ year + ablat + alloc, data=dat,
> level=1, fitfunction=rma.glmulti, crit="aicc", confsetsize=8, plotty=FALSE)
># check the fit of a model that includes alloc
>summary(res using objects[])
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On Behalf Of shuai
>Sent: Monday, 27 May, 2019 4:51
>To: r-sig-meta-analysis using r-project.org
>Subject: [R-meta] model selection using the glmulti
>I'd like to perform a model selection using the glmulti(http://www.metafor-project.org/doku.php/tips:model_selection_with_glmulti_and_mumin),
>I noticed that there are only continuous variables(length, wic, feedback, infor, pers, imag, meta) in this example: res <- glmulti(yi ~ length+ wic + feedback + info + pers + imag + meta, data=dat,
>level=1, fitfunction=rma.glmulti, crit="aicc", confsetsize=128)
>What if I have continuous variables and categorical variables? such as distance:1,2,3,10,20km...etc, and ecosystem types: grassland, wetland, cropland...etc
>Any help you can provide would be really appreciated!
>Thank you very much and looking forward to your reply!
More information about the R-sig-meta-analysis