tips:model_selection_with_glmulti_and_mumin
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tips:model_selection_with_glmulti_and_mumin [2021/03/16 20:16] – Wolfgang Viechtbauer | tips:model_selection_with_glmulti_and_mumin [2022/08/03 11:33] – Wolfgang Viechtbauer | ||
---|---|---|---|
Line 10: | Line 10: | ||
dat <- dat.bangertdrowns2004 | dat <- dat.bangertdrowns2004 | ||
</ | </ | ||
- | (I copy the dataset into ' | + | (I copy the dataset into ''dat'', which is a bit shorter and therefore easier to type further below). We can look at the first 10 and the last 10 rows of the dataset with: |
<code rsplus> | <code rsplus> | ||
rbind(head(dat, | rbind(head(dat, | ||
Line 132: | Line 132: | ||
Mixed-Effects Model (k = 41; tau^2 estimator: ML) | Mixed-Effects Model (k = 41; tau^2 estimator: ML) | ||
- | logLik | + | logLik |
- | | + | |
tau^2 (estimated amount of residual heterogeneity): | tau^2 (estimated amount of residual heterogeneity): | ||
Line 149: | Line 149: | ||
Model Results: | Model Results: | ||
- | | + | |
- | intrcpt | + | intrcpt |
- | imag | + | imag |
--- | --- | ||
Line 180: | Line 180: | ||
coef(res) | coef(res) | ||
</ | </ | ||
- | The output is not shown, because I don't find it very intuitive. But with a bit of extra code, we can make it more interpretable: | + | The output is not shown, because I don't find it very intuitive. But with a bit of extra code, we can make it more interpretable: |
<code rsplus> | <code rsplus> | ||
mmi <- as.data.frame(coef(res)) | mmi <- as.data.frame(coef(res)) | ||
Line 289: | Line 289: | ||
==== Using the MuMIn Package ==== | ==== Using the MuMIn Package ==== | ||
- | One disadvantage of the glmulti package is that it requires Java to be installed on the computer (so if you install and load the glmulti package and get an error that the '' | + | One disadvantage of the glmulti package is that it requires Java to be installed on the computer (so if you install and load the glmulti package and get an error that the '' |
First, we install and load the MuMIn package and then evaluate some code that generates two necessary helper functions we need so that MuMIn and metafor can interact as necessary: | First, we install and load the MuMIn package and then evaluate some code that generates two necessary helper functions we need so that MuMIn and metafor can interact as necessary: | ||
Line 310: | Line 310: | ||
</ | </ | ||
<code output> | <code output> | ||
- | Global model call: rma(yi = yi, vi = vi, mods = ~length + wic + feedback + info + | + | Global model call: rma(yi = yi, vi = vi, mods = ~length + wic + feedback + info + |
pers + imag + meta, data = dat, method = " | pers + imag + meta, data = dat, method = " | ||
--- | --- | ||
- | Model selection table | + | Model selection table |
| | ||
3 + | 3 + | ||
Line 334: | Line 334: | ||
</ | </ | ||
<code output> | <code output> | ||
- | Model-averaged coefficients: | + | Model-averaged coefficients: |
- | (full average) | + | (full average) |
- | Estimate Std. Error z value Pr(> | + | Estimate Std. Error z value Pr(> |
- | intrcpt | + | intrcpt |
imag 0.351153 | imag 0.351153 | ||
- | meta 0.051201 | + | meta 0.051201 |
- | feedback | + | feedback |
- | length | + | length |
- | wic -0.017004 | + | wic -0.017004 |
- | pers 0.013244 | + | pers 0.013244 |
- | info | + | info |
</ | </ | ||
I have removed some of the output, since this is the part we are most interested in. These are the same results as in object '' | I have removed some of the output, since this is the part we are most interested in. These are the same results as in object '' |
tips/model_selection_with_glmulti_and_mumin.txt · Last modified: 2022/10/13 06:07 by Wolfgang Viechtbauer