From edd at debian.org  Thu Mar 18 02:41:54 2010
From: edd at debian.org (Dirk Eddelbuettel)
Date: Wed, 17 Mar 2010 20:41:54 -0500
Subject: [Rd] y ~ X -1 , X a matrix
In-Reply-To: <1268868761.29395.122.camel@corn.betterworld.us>
References: <1268868761.29395.122.camel@corn.betterworld.us>
Message-ID: <19361.34018.650847.337178@ron.nulle.part>


On 17 March 2010 at 16:32, Ross Boylan wrote:
| While browsing some code I discovered a call to lm that used a formula y
| ~ X - 1, where X was a matrix.
| 
| Looking through the documentation of formula, lm, model.matrix and maybe
| some others I couldn't find this useage (R 2.10.1).  Is it anything I
| can count on in future versions?  Is there documentation I've
| overlooked?

>From help(formula):

  Details:

       In addition to ?+? and ?:?, a number of other operators are useful
       in model formulae.  [...] The
       ?-? operator removes the specified terms, so that ?(a+b+c)^2 -
       a:b? is identical to ?a + b + c + b:c + a:c?.  It can also used to
       remove the intercept term: ?y ~ x - 1? is a line through the
       origin.  A model with no intercept can be also specified as ?y ~ x
       + 0? or ?y ~ 0 + x?.

What exactly are you questioning? That X is a matrix? That doesn't take
away from the fact that the rest is a formula.

Dirk

-- 
  Registration is open for the 2nd International conference R / Finance 2010
  See http://www.RinFinance.com for details, and see you in Chicago in April!



[Rd] y ~ X -1 , X a matrix
Dirk Eddelbuettel