Data

\(n = 49\) species (19 carnivors, 30 herbivors); \(d = 3\) covariates \(x_{ij}\):

response variable: \(y_i =\) running speed (km /h)

##                       clade runningspeed log10bodymass hindlength mtfratio
## Ursus_maritimus   Carnivore           40     2.4232459      84.24    0.214
## Ursus_horribilis  Carnivore           48     2.4001925      65.20    0.220
## Ursus_americanus  Carnivore           48     1.9703469      66.83    0.200
## Nasua_narica      Carnivore           27     0.6434527      22.89    0.265
## Procyon_lotor     Carnivore           24     0.8450980      26.15    0.294
## Mephitis_mephitis Carnivore           16     0.3979400      14.65    0.265

## 
## Carnivore Herbivore 
##        19        30

Gaussian linear model for the running speed

Setting \(x_{i0} \equiv 1\) and \(\beta = [\beta_0 \dots \beta_d]^\intercal\), \[ Y_i \sim \mathcal{N}(x_i^\intercal \beta, \sigma^2). \] Or, denoting by \(i\) the clade (carnivor or herbivor) and numbering species by \(j\) within each clade \[ \mathbb{E}Y_{ij} =: \mu_{ij} = \mu + \alpha_i + \beta_2 x_{ij, 2} + + \beta_3 x_{ij, 3}. \]

## 
## Call:
## lm(formula = runningspeed ~ clade + log10bodymass + mtfratio, 
##     data = carniherb)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -41.051  -7.395   1.051   7.656  49.082 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      26.188      9.387   2.790  0.00771 ** 
## cladeHerbivore  -24.275      9.232  -2.629  0.01166 *  
## log10bodymass     4.887      4.273   1.144  0.25881    
## mtfratio         59.550     12.387   4.808 1.74e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.42 on 45 degrees of freedom
## Multiple R-squared:  0.3714, Adjusted R-squared:  0.3295 
## F-statistic: 8.864 on 3 and 45 DF,  p-value: 9.964e-05

Gaussian linear model for the running speed with interaction

Introducing interaction so that the effect of the continuous covariates differs from one clade to another \[ \mu_{ij} = \mu + \alpha_i + \beta_2 x_{ij, 2} + \beta_3 x_{ij, 3} + \gamma_{i2} x_{ij, 2} + \gamma_{i3} x_{ij, 3}. \]

## 
## Call:
## lm(formula = runningspeed ~ clade * (log10bodymass + mtfratio), 
##     data = carniherb)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -29.7331  -9.3277   0.4579   6.2951  31.0392 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   -46.352     18.010  -2.574 0.013590 *  
## cladeHerbivore                 80.694     24.846   3.248 0.002259 ** 
## log10bodymass                  18.938      5.382   3.519 0.001039 ** 
## mtfratio                      210.354     38.852   5.414 2.58e-06 ***
## cladeHerbivore:log10bodymass  -22.463      7.306  -3.075 0.003653 ** 
## cladeHerbivore:mtfratio      -167.377     40.399  -4.143 0.000157 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.82 on 43 degrees of freedom
## Multiple R-squared:  0.5746, Adjusted R-squared:  0.5251 
## F-statistic: 11.62 on 5 and 43 DF,  p-value: 3.904e-07

Model comparison

## Analysis of Variance Table
## 
## Model 1: runningspeed ~ clade + log10bodymass + mtfratio
## Model 2: runningspeed ~ clade * (log10bodymass + mtfratio)
##   Res.Df     RSS Df Sum of Sq      F    Pr(>F)    
## 1     45 12127.9                                  
## 2     43  8208.1  2    3919.7 10.267 0.0002264 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Analysis of covariance

With only one continuous covariate

## 
## Call:
## lm(formula = runningspeed ~ -1 + clade * (mtfratio), data = carniherb)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -29.268 -10.960   0.725   8.487  41.617 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## cladeCarnivore            -2.833     14.589  -0.194 0.846905    
## cladeHerbivore            23.868      9.819   2.431 0.019116 *  
## mtfratio                 162.593     40.570   4.008 0.000228 ***
## cladeHerbivore:mtfratio -116.406     42.108  -2.764 0.008236 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.4 on 45 degrees of freedom
## Multiple R-squared:  0.944,  Adjusted R-squared:  0.939 
## F-statistic: 189.6 on 4 and 45 DF,  p-value: < 2.2e-16