Re: [R] simple fit

2011-12-08 Thread Rolf Turner
If one knows y, x, and a, and wishes to estimate b in y = a*x + b (+ random error presumably) then surely the simplest procedure is b.hat <- mean(y-a*x) Is it not so? cheers, Rolf On 09/12/11 08:09, Ben Bolker wrote: R. Michael Weylandt gmail.com> writes: Fit y-b w

Re: [R] simple fit

2011-12-08 Thread Ben Bolker
R. Michael Weylandt gmail.com> writes: > Fit y-b without an intercept? (which you do by adding "+ 0" or "- 1" > to the model formula) Not sure if this is the optimal result, but it > will give you a pretty reasonable answer. This seems backward. The OP has the slope and wants the intercept. >

Re: [R] simple fit

2011-12-08 Thread R. Michael Weylandt
Fit y-b without an intercept? (which you do by adding "+ 0" or "- 1" to the model formula) Not sure if this is the optimal result, but it will give you a pretty reasonable answer. Michael On Thu, Dec 8, 2011 at 10:52 AM, Alaios wrote: > Dear all, >  I have a formula of the form > y=ax+b > I know

[R] simple fit

2011-12-08 Thread Alaios
Dear all,  I have a formula of the form y=ax+b I know everything except b. How I can ask R to do fitting to find only the value of b? I already know the lm() but it always return both an intercept point (b) and the a. What should I do ? I would like to thank you in advance for your help B.R Al