Re: [R] Weight in Function RM

2011-09-07 Thread Thomas Lumley
On Wed, Sep 7, 2011 at 4:28 PM, Suphajak Ngamlak wrote: > Dear all, > > I am trying to do weighted regression using lm function in R. However, I have > a question why the results from > > > 1)      lm(formula = Y~aX, weight = w) > > 2)      lm(formula = wY~waX) > > are different. Aren't they supp

[R] Weight in Function RM

2011-09-06 Thread Suphajak Ngamlak
Dear all, I am trying to do weighted regression using lm function in R. However, I have a question why the results from 1) lm(formula = Y~aX, weight = w) 2) lm(formula = wY~waX) are different. Aren't they supposed to have the exactly same result? Below are the R code to see differ