# The metafor Package

A Meta-Analysis Package for R

### Site Tools

tips:models_with_or_without_intercept

# Differences

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

 tips:models_with_or_without_intercept [2020/03/19 14:22]Wolfgang Viechtbauer tips:models_with_or_without_intercept [2021/02/12 15:53]Wolfgang Viechtbauer Both sides previous revision Previous revision 2021/11/10 20:19 Wolfgang Viechtbauer 2021/10/29 10:55 Wolfgang Viechtbauer 2021/02/12 16:09 Wolfgang Viechtbauer 2021/02/12 15:53 Wolfgang Viechtbauer 2020/10/31 08:46 Wolfgang Viechtbauer 2020/03/19 14:25 Wolfgang Viechtbauer [Models with Continuous Moderators] 2020/03/19 14:22 Wolfgang Viechtbauer 2019/06/30 11:43 external edit Next revision Previous revision 2021/11/10 20:19 Wolfgang Viechtbauer 2021/10/29 10:55 Wolfgang Viechtbauer 2021/02/12 16:09 Wolfgang Viechtbauer 2021/02/12 15:53 Wolfgang Viechtbauer 2020/10/31 08:46 Wolfgang Viechtbauer 2020/03/19 14:25 Wolfgang Viechtbauer [Models with Continuous Moderators] 2020/03/19 14:22 Wolfgang Viechtbauer 2019/06/30 11:43 external edit Next revision Both sides next revision Line 5: Line 5: ==== Model With Intercept ==== ==== Model With Intercept ==== - The dataset is called ''dat.bcg''. The variables ''tpos and ''tneg'' in the dataset indicate the number of tuberculosis cases and non-cases in the treated (vaccinated) groups, respectively. Similarly, variables ''cpos and ''cneg'' indicate the number of cases and non-cases in the control (non-vaccinated) groups. Based on these four variables, the (log) risk ratios and corresponding sampling variances for the 13 studies can be obtained with: + The dataset is called ''dat.bcg''. The variables ''tpos'' and ''tneg'' in the dataset indicate the number of tuberculosis cases and non-cases in the treated (vaccinated) groups, respectively. Similarly, variables ''cpos'' and ''cneg'' indicate the number of cases and non-cases in the control (non-vaccinated) groups. Based on these four variables, the (log) risk ratios and corresponding sampling variances for the 13 studies can be obtained with: library(metafor) library(metafor) Line 245: Line 245: ==== Parameterization ==== ==== Parameterization ==== - What the example above shows is that, whether we remove the intercept or not, we are essentially fitting the same model, but using a different [[wp>Parametrization_(geometry)|parameterization]]. The Wikipedia page linked to here discusses the idea of parameterization in the context of geometry, but this is directly relevant, since fundamentally the process of fitting (meta)-regression models can also be conceptualized geometrically (involving projections and vector spaces). An excellent (but quite technical) reference for this perspective is Christensen (2011). + What the example above shows is that, whether we remove the intercept or not, we are essentially fitting the same model, but using a different [[wp>Parametrization_(geometry)|parameterization]]. The Wikipedia page linked to here discusses the idea of parameterization in the context of geometry, but this is directly relevant, since fundamentally the process of fitting (meta)-regression models can also be conceptualized geometrically (involving projections and vector spaces). An excellent (but quite technical) reference for this perspective (on regression models in general) is Christensen (2011). ==== Models with Continuous Moderators ==== ==== Models with Continuous Moderators ==== Line 303: Line 303: - When the model only includes continuous (i.e., numeric) predictors/moderators, then removing the intercept does just that: it removes the intercept. Hence, the model above forces the intercept to be 0, that is, it assumes that at the equator, the (average) log risk ratio is exactly zero. This seems like a rather strong assumption to make, so I would not recommend doing so. In fact, only in rare cases is it ever appropriate to remove the intercept term from a regression model. + When the model only includes continuous (i.e., numeric) predictors/moderators, then removing the intercept does just that: it removes the intercept. Hence, the model above forces the intercept to be 0, that is, it assumes that at the equator, the (average) log risk ratio is exactly zero. This seems like a rather strong assumption to make, so I would not recommend doing so. In fact, only in rare cases is it ever appropriate to remove the intercept term from a regression model (that involves only continuous predictors/moderators). ==== References ==== ==== References ====