[R] testing for significantly different slopes

From: Dylan Beaudette <dylan.beaudette_at_gmail.com>
Date: Wed, 05 Mar 2008 15:28:00 -0800


Hi,

How would one go about determining if the slope terms from an analysis of covariance model are different from eachother?

Based on the example from MASS:

library(MASS)

# parallel slope model

l.para <- lm(Temp ~ Gas + Insul, data=whiteside)

# multiple slope model

l.mult <- lm(Temp ~ Insul/Gas -1, data=whiteside)

# compare nested models:

anova(l.para, l.mult)
Analysis of Variance Table

Model 1: Temp ~ Gas + Insul
Model 2: Temp ~ Insul/Gas - 1

  Res.Df    RSS Df Sum of Sq      F  Pr(>F)  
1     53 52.045                              
2     52 48.704  1     3.341 3.5673 0.06451 .

It seems like this approach would yield insight into whether or not the two slope terms (InsulBefore:Gas and InsulAfter:Gas) were different. However, is there a formal test for this sort of question, and can it be generalized to differences between more than 2 slope terms?

Thanks,

Dylan

-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341

______________________________________________
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.
Received on Wed 05 Mar 2008 - 23:29:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 06 Mar 2008 - 00:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive