# The metafor Package

A Meta-Analysis Package for R

### Site Tools

tips:multiple_factors_interactions

# Differences

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

 tips:multiple_factors_interactions [2021/10/22 14:44]Wolfgang Viechtbauer tips:multiple_factors_interactions [2021/11/10 20:20] (current)Wolfgang Viechtbauer Both sides previous revision Previous revision 2021/11/10 20:20 Wolfgang Viechtbauer 2021/10/22 14:44 Wolfgang Viechtbauer 2020/06/26 06:49 Wolfgang Viechtbauer 2018/12/08 13:22 external edit 2021/11/10 20:20 Wolfgang Viechtbauer 2021/10/22 14:44 Wolfgang Viechtbauer 2020/06/26 06:49 Wolfgang Viechtbauer 2018/12/08 13:22 external edit Line 109: Line 109: We have also not yet tested whether there is a difference between levels ''some'' and ''high'' of this factor. One could change the reference level of the ''weeks'' factor and refit the model to obtain this test. Alternatively, and more elegantly, we can just test the difference between these two coefficients directly. We can do this with: We have also not yet tested whether there is a difference between levels ''some'' and ''high'' of this factor. One could change the reference level of the ''weeks'' factor and refit the model to obtain this test. Alternatively, and more elegantly, we can just test the difference between these two coefficients directly. We can do this with: - anova(res.a1, L=c(0,1,-1,0)) + anova(res.a1, X=c(0,1,-1,0)) Line 339: Line 339: Now, the table with the model results directly provides the estimated average effect for each factor level combination. It is now also quite easy to test particular factor level combinations against each other. For example, to test the difference between levels ''some'' and ''high'' of the ''weeks'' factor within the ''blind'' level of the ''tester'' factor, we could use: Now, the table with the model results directly provides the estimated average effect for each factor level combination. It is now also quite easy to test particular factor level combinations against each other. For example, to test the difference between levels ''some'' and ''high'' of the ''weeks'' factor within the ''blind'' level of the ''tester'' factor, we could use: - anova(res.i2, L=c(0,1,-1,0,0,0)) + anova(res.i2, X=c(0,1,-1,0,0,0)) Line 365: Line 365: To test the same contrast within the ''aware'' level of the ''tester'' factor, we would use: To test the same contrast within the ''aware'' level of the ''tester'' factor, we would use: - anova(res.i2, L=c(0,0,0,0,1,-1)) + anova(res.i2, X=c(0,0,0,0,1,-1))