Clarifying vague interactions
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
For some reason, authors occasionally present linear model results with vague or unintelligible interaction effects. One way to be vague when presenting interaction effects is to provide only a table of model coefficients, including no information on the range of covariate values observed, and no plots to aid in interpretation. Here’s an example:
Suppose you have discovered a statistically significant interaction effect between two continous covariates in the context of a linear model.
Suppose also that you have decided to present the model results with the following table, and the reviewers requested no additional information:
Estimate | SE | P-value | |
---|---|---|---|
$\beta_0$ | -0.004 | 0.037 | 0.921 |
$\beta_1$ | 1.055 | 0.038 | <0.05 |
$\beta_2$ | -0.496 | 0.037 | <0.05 |
$\beta_3$ | 2.002 | 0.040 | <0.05 |
RSE | 0.517 | ||
Without knowing the range of covariate values observed, this table gives an incomplete story about relationship between the covariates and the response variable. Assuming the reader has a decent guess about the range of possible values for the covariates, this is what they can piece together:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<span class="line"><span class="c1"># parameter estimates</span> </span><span class="line">beta0 <span class="o"><-</span> <span class="m">-.004</span> </span><span class="line">beta1 <span class="o"><-</span> <span class="m">1.055</span> </span><span class="line">beta2 <span class="o"><-</span> <span class="m">-.496</span> </span><span class="line">beta3 <span class="o"><-</span> <span class="m">2.002</span> </span><span class="line"> </span><span class="line"><span class="c1"># reader's guess: range of possible covariate values</span> </span><span class="line">x1 <span class="o"><-</span> seq<span class="p">(</span><span class="m">-5</span><span class="p">,</span> <span class="m">5</span><span class="p">,</span> <span class="m">.1</span><span class="p">)</span> </span><span class="line">x2 <span class="o"><-</span> seq<span class="p">(</span><span class="m">-5</span><span class="p">,</span> <span class="m">5</span><span class="p">,</span> <span class="m">.1</span><span class="p">)</span> </span><span class="line">X <span class="o"><-</span> expand.grid<span class="p">(</span>x1<span class="o">=</span>x1<span class="p">,</span> x2<span class="o">=</span>x2<span class="p">)</span> </span><span class="line"> </span><span class="line"><span class="c1"># reader's attempt to know how the covariates relate to E(y)</span> </span><span class="line">mu <span class="o"><-</span> with<span class="p">(</span>X<span class="p">,</span> beta0 <span class="o">+</span> beta1<span class="o">*</span>x1 <span class="o">+</span> beta2<span class="o">*</span>x2 <span class="o">+</span> beta3<span class="o">*</span>x1<span class="o">*</span>x2<span class="p">)</span> </span><span class="line"> </span><span class="line">require<span class="p">(</span>ggplot2<span class="p">)</span> </span><span class="line">d <span class="o"><-</span> data.frame<span class="p">(</span>mu<span class="o">=</span>mu<span class="p">,</span> x1<span class="o">=</span>X<span class="o">$</span>x1<span class="p">,</span> x2<span class="o">=</span>X<span class="o">$</span>x2<span class="p">)</span> </span><span class="line">p1 <span class="o"><-</span> ggplot<span class="p">(</span>d<span class="p">,</span> aes<span class="p">(</span>x1<span class="p">,</span> x2<span class="p">,</span> z<span class="o">=</span>mu<span class="p">))</span> <span class="o">+</span> theme_bw<span class="p">()</span> <span class="o">+</span> </span><span class="line"> geom_tile<span class="p">(</span>aes<span class="p">(</span>fill<span class="o">=</span>mu<span class="p">))</span> <span class="o">+</span> </span><span class="line"> stat_contour<span class="p">(</span>binwidth<span class="o">=</span><span class="m">1.5</span><span class="p">)</span> <span class="o">+</span> </span><span class="line"> scale_fill_gradient2<span class="p">(</span>low<span class="o">=</span><span class="s">"blue"</span><span class="p">,</span> mid<span class="o">=</span><span class="s">"white"</span><span class="p">,</span> high<span class="o">=</span><span class="s">"orange"</span><span class="p">)</span> <span class="o">+</span> </span><span class="line"> xlab<span class="p">(</span><span class="s">"Covariate 1"</span><span class="p">)</span> <span class="o">+</span> ylab<span class="p">(</span><span class="s">"Covariate 2"</span><span class="p">)</span> <span class="o">+</span> </span><span class="line"> ggtitle<span class="p">(</span><span class="s">"Contour plot of E(y)"</span><span class="p">)</span> </span><span class="line">p1 </span> |
If the reader does not know where the observations fell in this plot, it is difficult to know whether the response variable was increasing or decreasing with each covariate across the range of observed values.
Consider the following two cases, where the observed covariate combinations are included as points.
These two plots tell somewhat different stories despite identical model parameters. On the left, across the range of observed covariates, the expected value of $y$ increases as either covariate increases and the interaction term affects the magnitude this increase. On the right, increases in covariate 1 or 2 could increase or decrease $\mu$, depending on the value of the other covariate.
I won’t get into the nitty gritty of how to present interaction effects (but if you’re interested, there are articles out there, e.g. Lamina et al. 2012). My main goal here is to point out the ambiguity associated with only presenting a table of parameter estimates. My preference would be that authors at least present observed covariate ranges (or better yet values), and provide a plot that illustrates the interaction.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.