The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


tips:multiple_factors_interactions

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tips:multiple_factors_interactions [2021/10/22 14:44] Wolfgang Viechtbauertips:multiple_factors_interactions [2021/11/10 20:20] Wolfgang Viechtbauer
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:
 <code rsplus> <code rsplus>
-anova(res.a1, L=c(0,1,-1,0))+anova(res.a1, X=c(0,1,-1,0))
 </code> </code>
 <code output> <code output>
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:
 <code rsplus> <code rsplus>
-anova(res.i2, L=c(0,1,-1,0,0,0))+anova(res.i2, X=c(0,1,-1,0,0,0))
 </code> </code>
 <code output> <code output>
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:
 <code rsplus> <code rsplus>
-anova(res.i2, L=c(0,0,0,0,1,-1))+anova(res.i2, X=c(0,0,0,0,1,-1))
 </code> </code>
 <code output> <code output>
tips/multiple_factors_interactions.txt · Last modified: 2023/05/30 07:51 by Wolfgang Viechtbauer