Suppose we have at our disposal a glm() that's got all the typical features except the ability to specify weights. Intuitively, I can trick it into using weights (if the weights are integer) if I duplicate some records, e.g. if a record has weight = 2 I'd include an extra identical row of it in my data. Now, this seems to work from some testing, but why does it work from a theoretical and algorithmic standpoint?

  • 1
    $\begingroup$ To clarify, this is the context (from R documentation): Non-NULL weights can be used to indicate that different observations have different dispersions (with the values in weights being inversely proportional to the dispersions); or equivalently, when the elements of weights are positive integers w_i, that each response y_i is the mean of w_i unit-weight observations. For a binomial GLM prior weights are used to give the number of trials when the response is the proportion of successes: they would rarely be used for a Poisson GLM. $\endgroup$ – kevinykuo Mar 23 '15 at 15:56

Weights are weird things, as they have many meanings. You seem to be talking about frequency weights, which will work if you do this. But if they are sampling weights, this won't work - first, because the weights are frequently not integers, and second because the sample size will be wrong.

One solution for non-integer frequency weights is to multiply all the weights by (say) 10,000, then use this procedure, then recalculate standard errors based on the correct sample size.

However, I've now read your comment, and realize you're talking about weighted least squares. .

In ordinary least squares regression we minimize the sum of weighted residuals:

$\Sigma(y_i -\hat{y}_i)^2 $

In weighted least squares regression, we minimize the sum of the weighted residuals.

$\Sigma w_i (y_i -\hat{y}_i)^2 $

Which is usually used to handle heteroscedasticity. The weights aren't doing the same thing, so this won't work.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.