# Weighted GLM without weights

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?

• 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. – 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.

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