[R] How to decide " weight" in WLS model in R ?

Yan Wu yanwu1205 at gmail.com
Mon Mar 2 21:13:53 CET 2015


Hi,

I would like to know how to decide the "weight" in a WLS model in R?

For example, In the" pipeline " data from faraway, I try to fit a
regression model Lab ~ Field (non-constant variance). I wish to use weights
to account for the non-constant variance. So how to decide the weight in
the WLS model?

For the "pipeline" data, they split the range of Field into 12 groups of
size 9. within each group, and they compute the variance of Lab as "varlab"
and the mean of Field as "meanfield". In addition, they suppose that the
variance in the response is linked to the predictor in the following way:
var(Lab)=a*(Field^b).

So we could get a estimate of a and b by regress log(varlab) on
log(meanfield). But how to determine weights in a WLS fit of Lab on Field
in R?

I guess that it may require the function of 'VarConstPower' in R in the
example above. So could you please explain how to use 'VarConstPower' in R?

I will appreciate it if you could please answer the two questions above.

Thanks!
Angela
-

	[[alternative HTML version deleted]]



More information about the R-help mailing list