[R] ANCOVA for linear regressions without intercept

From: Yusuke Fukuda <Yusuke.Fukuda_at_nt.gov.au>
Date: Thu, 31 Mar 2011 16:12:46 +0930

Hello R experts

I have two linear regressions for sexes (Male, Female, Unknown). All have a good correlation between body length (response variable) and head length (explanatory variable). I know it is not recommended, but for a good practical reason (the purpose of study is to find a single conversion factor from head length to body length), the regressions need to go through the origin (0 intercept).

Is it possible to do ANCOVA for these regressions without intercepts? When I do

summary(lm(body length ~ sex*head length))

this will include the intercepts as below


                       Estimate Std. Error t value Pr(>|t|)    
(Intercept)            -6.49697    1.68497  -3.856 0.000118 ***
sexMale                -9.39340    1.97760  -4.750 2.14e-06 ***
sexUnknown             -1.33791    2.35453  -0.568 0.569927    
head_length             7.12307    0.05503 129.443  < 2e-16 ***
sexMale:head_length     0.31631    0.06246   5.064 4.37e-07 ***
sexUnknown:head_length 0.19937 0.07022 2.839 0.004556 ** ---

Is there any way I can remove the intercepts so that I can simply compare the slopes with no intercept taken into account?

Thanks for help in advance.

Yusuke Fukuda

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 Thu 31 Mar 2011 - 07:30:42 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 31 Mar 2011 - 15:40:26 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