[R] Comparing two lines - Ancova: lm or aov?

Dylan Beaudette dylan.beaudette at gmail.com
Mon Apr 18 21:47:10 CEST 2011


Analysis of covariance comes to mind, and it looks like you have
already setup your data for that type of analysis. I can't speak on
issues related to the different number of samples (maybe a place for
mixed modeling?), but from the results below (from lm) it looks like
you can conclude that the two slopes aren't all that different. Any
interpretation of 'statistical significance' at some defined cutoff
(i.e. p < 0.05) will have to be scrutinized in regards to whether or
not your samples are truly IID.

Good luck,
Dylan

On Mon, Apr 18, 2011 at 12:13 PM, Anne Kirsten Bowser
<akbowser at gmail.com> wrote:
> Hello!
>
> I have measurements (length and volume) of fish collected in two years. I
> want to know if the the relationship between length and volume is the same
> for both years. The number of fish measured is different for each year. I
> don't know whether lm or aov is more appropriate to use.
>
> Here are the two output options:
>
> Call:
> lm(formula = Volume ~ Length * Year)
>
> Residuals:
>     Min       1Q   Median       3Q      Max
> -1.35062 -0.42695 -0.02234  0.29789  1.78540
>
> Coefficients:
>                  Estimate Std. Error t value Pr(>|t|)
> (Intercept)      -8.699125   0.543372 -16.010   <2e-16 ***
> Length            0.151462   0.006708  22.578   <2e-16 ***
> Year1         1.627903   1.168158   1.394   0.1660
> Length:Year1 -0.024259   0.014510  -1.672   0.0972 .
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Residual standard error: 0.6016 on 119 degrees of freedom
> Multiple R-squared: 0.8384,     Adjusted R-squared: 0.8343
> F-statistic: 205.8 on 3 and 119 DF,  p-value: < 2.2e-16
>
> ----
> AND for aov:
> ----
>
>               Df  Sum Sq Mean Sq  F value    Pr(>F)
> Length          1 219.457 219.457 606.4349 < 2.2e-16 ***
> Year          1   2.970   2.970   8.2073  0.004934 **
> Length:Year   1   1.012   1.012   2.7952  0.097173 .
> Residuals     119  43.064   0.362
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
>
> Thanks very much for any help.
> Kirsten
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



More information about the R-help mailing list