Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.GSO.4.21.0005020852420.6086-100000@mail.biostat.washington.edu>
Date: 2000-05-02T15:55:46Z
From: Thomas Lumley
Subject: Variable names in model formula
In-Reply-To: <390ef74b.10701960@fisher.stats.uwo.ca>

On Tue, 2 May 2000, Duncan Murdoch wrote:
> 
> I just discovered a nice way to do this in S-PLUS the other day; it
> doesn't work in R 0.99, but I don't have version 1 installed on this
> machine to check there.
> 
> The terms() function in S-PLUS returns an expression listing the terms
> in a model formula.  It is nice to manipulate:
> 
>  formula(terms(somefit)[1]) gives the model formula using just the
> first term,
> 
>  formula(terms(somefit)[-1]) gives the model formula leaving out the
> first term, 

I wrote this for the survival{4,5} packages, where it's used to hack apart
model formulas and meddle with the strata() and cluster() terms.  I think
there's just never been any call for it in the base package before now.

	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._