Re: [R] Obtaining a quadratic function igven three points on a curve

2011-01-20 Thread Joshua Wiley
Many thanks for the correction David. Josh On Thu, Jan 20, 2011 at 7:17 AM, David Scott wrote: > I think you need poly(X, 2,  raw = TRUE) to interpret the coefficients in > the manner described below. > > poly uses orthogonal polynomials by default: > > poly                   package:stats      

Re: [R] Obtaining a quadratic function igven three points on a curve

2011-01-20 Thread David Scott
I think you need poly(X, 2, raw = TRUE) to interpret the coefficients in the manner described below. poly uses orthogonal polynomials by default: poly package:stats R Documentation Compute Orthogonal Polynomials Description: Returns or evaluates orth

Re: [R] Obtaining a quadratic function igven three points on a curve

2011-01-20 Thread Joshua Wiley
Hi Barth, Here is an option fitting a linear model toa second order polynomial and extracting the coefficients. The Intercept corresponds to "c" in your email, then poly(...)1 to "b" and poly(...)2 to "a". dat <- read.table(textConnection(" Y X 0.159529 0 0.5 0.773019 1 1"), he

[R] Obtaining a quadratic function igven three points on a curve

2011-01-20 Thread Barth B. Riley
Hello I would like to obtain the coefficients for a quadratic function (ax^2 + bx + c) given three sets of points on the quadratic curve. For instance: Y X 0.1595290 0.5 0.773019 1 1 Is there a function in R to obta