The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


tips:model_selection_with_glmulti_and_mumin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tips:model_selection_with_glmulti_and_mumin [2022/08/09 13:15] Wolfgang Viechtbauertips:model_selection_with_glmulti_and_mumin [2022/10/13 06:07] (current) Wolfgang Viechtbauer
Line 260: Line 260:
 <code rsplus> <code rsplus>
 glmulti(yi ~ length + wic + feedback + info + pers + imag + meta, data=dat, glmulti(yi ~ length + wic + feedback + info + pers + imag + meta, data=dat,
-        level=2, method="d", fitfunction=rma.glmulti, crit="aicc")+        level=2, marginality=TRUE, method="d", fitfunction=rma.glmulti, crit="aicc")
 </code> </code>
 <code output> <code output>
-Initialization...+Initialization...                                                                                                       
 TASK: Diagnostic of candidate set. TASK: Diagnostic of candidate set.
 Sample size: 41 Sample size: 41
Line 275: Line 275:
 Size constraints: min =  0 max = -1 Size constraints: min =  0 max = -1
 Complexity constraints: min =  0 max = -1 Complexity constraints: min =  0 max = -1
-Your candidate set contains 268435456 models. +Marginality rule. 
-[1] 268435456+Your candidate set contains 2350602 models. 
 +[1] 2350602
 </code> </code>
  
-So, the candidate set would include over $2 \times 10^8$ possible models. Fitting all of these models would not only test our patience (and would be a waste of valuable CPU cycles), it would also be a pointless exercise (even fitting the 128 models above could be critiqued by some as a mindless hunting expedition -- although if one does not get too fixated on //the// best model, but considers all the models in the set as part of a multimodel inference approach, this critique loses some of its force). So, I won't consider this any further in this example+So, the candidate set would include over two million possible models. Fitting all of these models would not only test our patience (and would be a waste of valuable CPU cycles), it would also be a pointless exercise (even fitting the 128 models above could be critiqued by some as a mindless hunting expedition -- although if one does not get too fixated on //the// best model, but considers all the models in the set as part of a multimodel inference approach, this critique loses some of its force). So, I won't consider this any further in this example.
- +
-==== Other Model Types ==== +
- +
-The same principle can of course be applied when fitting other types of models, such as those that can be fitted with the ''rma.mv()'' or ''rma.glmm()'' functions. One just has to write an appropriate ''rma.glmulti'' function. +
- +
-For multivariate/multilevel models fitted with the ''rma.mv()'' function, one can also consider model selection with respect to the random effects structure. Making this work would require a bit more work. Time permitting, I might write up an example illustrating this at some point in the future.+
  
 ==== Using the MuMIn Package ==== ==== Using the MuMIn Package ====
Line 358: Line 353:
 </code> </code>
 These are again the same values we obtained earlier. These are again the same values we obtained earlier.
 +
 +==== Other Model Types ====
 +
 +The same principle can of course be applied when fitting other types of models, such as those that can be fitted with the ''rma.mv()'' or ''rma.glmm()'' functions. One just has to write an appropriate ''rma.glmulti'' function when using the glmulti package (when using the MuMIn package, one simply applies the ''dredge()'' function to the full model). An example illustrating the use of model selection with a fairly complex ''rma.mv()'' model can be found [[https://gist.github.com/wviechtb/891483eea79da21d057e60fd1e28856b|here]] (the example involves only a small number of predictors, but also considers their interaction and also illustrates using parallel processing when using the ''dredge()'' function).
 +
 +For multivariate/multilevel models fitted with the ''rma.mv()'' function, one can also consider model selection with respect to the random effects structure. Making this work would require a bit more work. Time permitting, I might write up an example illustrating this at some point in the future.
  
 ==== References ==== ==== References ====
tips/model_selection_with_glmulti_and_mumin.txt · Last modified: 2022/10/13 06:07 by Wolfgang Viechtbauer