Unfortunately, I don't think lm/LinearModel supports weights currently,
though the code is prepared in some places to handle them.
You can fit a generalized linear model with a normal distribution
instead, but weights will be interpreted as case weights, while
weighted least squares would correspond to inverse-variance/precision
weights. This is currently underdocumented. The code to do that would
be:
df = DataFrame(x=x, y=y, w=w)
fit(GeneralizedLinearModel, y ~ x, df, Normal(), IdentityLink(), wts=w)
Contributions would be welcome of course!
Regards
> Best,
> 
> Tamas
>