[R] Compare a group of line slopes

Juliet Hannah juliet.hannah at gmail.com
Fri Sep 18 14:59:15 CEST 2009


The test that a slope differs by group is a test that the
variable*group interaction equals
zero (overall test). Maybe searching post-hoc comparisons in
regression will give you some
leads.

On Tue, Sep 15, 2009 at 10:57 AM, Jun Shen <jun.shen.ut at gmail.com> wrote:
> Hi, all,
>
> I am thinking to compare a group of slopes from regression lines to see if
> they are different overall, and then make specific comparisons between
> groups. How can I achieve that in R?  I searched the archives and there are
> only discussions about comparing two lines a time.  Thanks.
>
> A sample data set is like the following. I would like to compare the
> regression slopes between the five groups. Thanks for your help.
>
> data<-data.frame(x=rep(1:10,5),y=rnorm(50),group=rep(1:5,each=10))
>
> Jun Shen
>
>        [[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