[R] a problem about WLS
tlumley at uw.edu
Thu Jul 5 05:37:05 CEST 2012
On Thu, Jul 5, 2012 at 11:40 AM, jacquesliu <jacquesliu at gmail.com> wrote:
> I was asked to do a WLS estimation, so I thought of lm() with weights like
> however, it gives different result as below code, which use the formula of
> Can anybody explain to me why the first code can not give the right answer?
The two examples are using the opposite weights. To replicate the
answer from the second approach with lm, use weight=INC^-1
In lm(), observations with high weights have more, um, weight. They
influence the results more than observations with low weight. Your
code does the opposite.
Professor of Biostatistics
University of Auckland
More information about the R-help