From ripley at stats.ox.ac.uk  Mon Oct 19 12:02:02 2009
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon, 19 Oct 2009 11:02:02 +0100 (BST)
Subject: [Rd] Use of lm on polynomial models (PR#14014)
In-Reply-To: <alpine.LFD.2.00.0910191035490.13539@gannet.stats.ox.ac.uk>
References: <20091018183016.B7EDB282EF53@mail.pubhealth.ku.dk>
	<alpine.LFD.2.00.0910191035490.13539@gannet.stats.ox.ac.uk>
Message-ID: <alpine.LFD.2.00.0910191058580.30653@gannet.stats.ox.ac.uk>

Others beware: this address does not accept replies, in defiance of 
the posting guide.

On Mon, 19 Oct 2009, Prof Brian Ripley wrote:

> RTFM time: h^3 is not the cube of h in an R formula (for that you need 
> I(h^3)).  See ?formula, for example.
>
> Simpler would be lm(w ~ poly(h, 3, raw=TRUE))
>
>
> On Sun, 18 Oct 2009, michael_karsh at earthlink.net wrote:
>
>> Full_Name: Michael Aaron Karsh
>> Version: 2.8.0.
>> OS: Windows XP
>> Submission from: (NULL) (75.61.102.255)
>> 
>> 
>> When I try lm(w ~ h^3 + h^2 + h) for example, it only gives coefficients 
>> for the intercept and for h.  It does not give coefficients for h^2 or h^3.
>
> So it is behaving correctly.
>
>
> -- 
> 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
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
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] Use of lm on polynomial models (PR#14014)
Prof Brian Ripley