tips:multiple_imputation_with_mice_and_metafor
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
tips:multiple_imputation_with_mice_and_metafor [2019/10/09 12:46] – external edit 127.0.0.1 | tips:multiple_imputation_with_mice_and_metafor [2020/07/10 11:16] – Wolfgang Viechtbauer | ||
---|---|---|---|
Line 133: | Line 133: | ||
One way of dealing with missing data is to make use of imputation techniques. The advantage of using [[wp> | One way of dealing with missing data is to make use of imputation techniques. The advantage of using [[wp> | ||
- | The mice package allows us to automate this process and can be used in combination with the metafor package. First, we install and load the mice package | + | The [[https:// |
<code rsplus> | <code rsplus> | ||
install.packages(" | install.packages(" | ||
library(mice) | library(mice) | ||
- | eval(metafor::: | ||
</ | </ | ||
Line 209: | Line 208: | ||
</ | </ | ||
- | And finally, we can pool the results with: | + | And finally, we can pool (and round) |
<code rsplus> | <code rsplus> | ||
- | pool <- pool(fit) | + | pool <- summary(pool(fit)) |
- | round(summary(pool), 4) | + | pool[-1] <- round(pool[-1], digits=4) |
+ | pool | ||
</ | </ | ||
<code output> | <code output> | ||
- | | + | |
- | intrcpt | + | 1 intrcpt |
- | length | + | 2 |
- | wic1 | + | 3 |
- | feedback1 | + | 4 feedback1 |
- | info1 -0.3133 | + | 5 info1 -0.3133 |
- | pers1 -0.3233 | + | 6 pers1 -0.3233 |
- | imag1 | + | 7 imag1 |
- | meta1 | + | 8 meta1 |
</ | </ | ||
For easier comparison, let's look at the coefficient table based on the complete case analysis obtained earlier: | For easier comparison, let's look at the coefficient table based on the complete case analysis obtained earlier: | ||
<code rsplus> | <code rsplus> | ||
- | round(coef(summary(res)), | + | round(coef(summary(res)), |
</ | </ | ||
<code output> | <code output> | ||
- | | + | |
- | intrcpt | + | intrcpt |
- | length | + | length |
- | wic -0.0472 0.1097 -0.4308 0.6666 -0.2622 0.1677 | + | wic -0.0472 0.1097 -0.4308 0.6666 -0.2622 0.1677 |
- | feedback | + | feedback |
- | info | + | info |
- | pers | + | pers |
- | imag 0.4106 0.1847 | + | imag 0.4106 0.1847 |
- | meta 0.2010 0.1742 | + | meta 0.2010 0.1742 |
</ | </ | ||
tips/multiple_imputation_with_mice_and_metafor.txt · Last modified: 2022/08/03 11:35 by Wolfgang Viechtbauer