# [R] lmodel2 - regression through origin?

ekwaters ekwaters at unimelb.edu.au
Thu May 21 04:34:19 CEST 2009

```Hi all,

is regression through the origin possible at all using lmodel2?

I tried the standard technique of inserting a minus 1 into the formula to
get regression through the origin in R, but the output still gives me an
intercept?

For comparison, this is me trying to do regression through the origin:

> test2.res<-lmodel2(mcr~m-1, data=test, "interval", "interval", nperm=99)
> test2.res

Model II regression

Call: lmodel2(formula = mcr ~ m - 1, data = test, range.y = "interval",
range.x = "interval", nperm = 99)

n = 13   r = 0.9801157   r-square = 0.9606268
Parametric P-values:   2-tailed = 4.491109e-09    1-tailed = 2.245554e-09
Angle between the two OLS regression lines = 0.440334 degrees

Permutation tests of OLS, MA, RMA slopes: 1-tailed, tail corresponding to
sign
A permutation test of r is equivalent to a permutation test of the OLS slope
P-perm for SMA = NA because the SMA slope cannot be tested

Regression results
Method  Intercept     Slope  Angle (degrees)  P-perm (1-tailed)
1    OLS -0.1053969  4.928172         78.52957               0.01
2     MA -0.1261714  5.122467         78.95373               0.01
3    SMA -0.1160872  5.028153         78.75177                 NA
4    RMA -0.1167458  5.034313         78.76519               0.01

and below is the output and formula input when I omit the -1. Does lmodel2
function/ package not understand what I want?

> test1.res<-lmodel2(mcr~m, data=test, "interval", "interval", nperm=99)
> test1.res

Model II regression

Call: lmodel2(formula = mcr ~ m, data = test, range.y = "interval",
range.x = "interval", nperm = 99)

n = 13   r = 0.9801157   r-square = 0.9606268
Parametric P-values:   2-tailed = 4.491109e-09    1-tailed = 2.245554e-09
Angle between the two OLS regression lines = 0.440334 degrees

Permutation tests of OLS, MA, RMA slopes: 1-tailed, tail corresponding to
sign
A permutation test of r is equivalent to a permutation test of the OLS slope
P-perm for SMA = NA because the SMA slope cannot be tested

Regression results
Method  Intercept     Slope  Angle (degrees)  P-perm (1-tailed)
1    OLS -0.1053969  4.928172         78.52957               0.01
2     MA -0.1261714  5.122467         78.95373               0.01
3    SMA -0.1160872  5.028153         78.75177                 NA
4    RMA -0.1167458  5.034313         78.76519               0.01

Ned
--
View this message in context: http://www.nabble.com/lmodel2---regression-through-origin--tp23646915p23646915.html
Sent from the R help mailing list archive at Nabble.com.

```