Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.A41.4.44.0203041518200.144620-100000@homer10.u.washington.edu>
Date: 2002-03-04T23:19:08Z
From: Thomas Lumley
Subject: Solving quadratic functions
In-Reply-To: <1F8EDF0AE0FFC643BC8FE577BC4919E624AD99@tomtom-wb.mel.foodscience.afisc.csiro.au>

On Tue, 5 Mar 2002 Peter.Watkins at foodscience.afisc.csiro.au wrote:

> I'm examining the use of the 'lm' function to solve quadratic functions.
>
> With S+ 2000, the 'lm' function can be used to solve eqns such as x1 + x2 +
> x1^2 + x2^2 + x1*x2.
> But, when trying this same eqn with R, the software does not produce any
> coefficients for x1^2 or x2^2.
>
> Is this a common problem?

Well, it's a FAQ

Differences between R & S: Models
   Whereas in S, you would use lm(y ~ x^3) to regress y on x^3, in R, you
   have to insulate powers of numeric vectors (using I()), i.e., you have
   to use lm(y ~ I(x^3)).


	-thomas


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._