Re: [R] a problem about WLS

2012-07-05 Thread jacquesliu
thanks a lot, it works On Thu, Jul 5, 2012 at 11:40 AM, Thomas Lumley-2 [via R] < ml-node+s789695n4635453...@n4.nabble.com> wrote: > On Thu, Jul 5, 2012 at 11:40 AM, jacquesliu <[hidden > email]> > wrote: > > > I was asked to do a WLS estimat

Re: [R] a problem about WLS

2012-07-04 Thread Thomas Lumley
On Thu, Jul 5, 2012 at 11:40 AM, jacquesliu wrote: > I was asked to do a WLS estimation, so I thought of lm() with weights like > wls=lm(Y~X-1,weight=INC) > > however, it gives different result as below code, which use the formula of > WLS > y<-Y*INC^-0.5 > x<-X*INC^-0.5 > wls=lm(y~x-1) > > Can an

[R] a problem about WLS

2012-07-04 Thread jacquesliu
I was asked to do a WLS estimation, so I thought of lm() with weights like wls=lm(Y~X-1,weight=INC) however, it gives different result as below code, which use the formula of WLS y<-Y*INC^-0.5 x<-X*INC^-0.5 wls=lm(y~x-1) Can anybody explain to me why the first code can not give the right answer?