From ripley at stats.ox.ac.uk  Wed Mar 19 15:42:40 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 19 Mar 2008 14:42:40 +0000 (GMT)
Subject: [Rd] how to exclude terms preceded by - from model frame
In-Reply-To: <39B6DDB9048D0F4DAD42CB26AAFF0AFA056BA9F7@usctmx1106.merck.com>
References: <39B6DDB9048D0F4DAD42CB26AAFF0AFA056BA9F7@usctmx1106.merck.com>
Message-ID: <alpine.LFD.1.00.0803191440530.5404@gannet.stats.ox.ac.uk>

On Wed, 19 Mar 2008, Liaw, Andy wrote:

> [I believe few users manipulate formulae and model frames like this, so
> I'm posting here instead of R-help.]
>
> I just found out that model.frame() includes all terms, including those
> preceded by "-" in the formula, in its output (as mentioned on its help
> page).  Is there a recommended way of excluding "negative" terms?  My
> guess is that I can use info in the terms attribute to figure this out,
> but that doesn't seem very straightforward.  Any pointer would be much
> appreciated.

?terms.formula, argument 'simplify', if I understand you aright.


>
> Best,
> Andy
>
> Andy Liaw, PhD
> Biometrics Research    PO Box 2000 RY33-300
> Merck Research Labs        Rahway, NJ 07065
> andy_liaw(a)merck.com          732-594-0820


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] how to exclude terms preceded by - from model frame
Prof Brian Ripley