Skip to content

simple fit

4 messages · Alaios, R. Michael Weylandt, Ben Bolker +1 more

#
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 <alaios at yahoo.com> wrote:
#
R. Michael Weylandt <michael.weylandt <at> gmail.com> writes:
This seems backward.  The OP has the slope and wants the intercept.
Or:

  lm (y~1,offset=a*x,data= ...) 

or

  lm(y-a*x~1,data=...)  [not sure this will evaluate the full
expresson on the LHS but it might]
#
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: