Assuming that we have a dataset with the respondents on each row (N respondents) and their respective characteristics as columns (C characteristics). Each respondent has also a weight.

In case of high number of respondents, is it a good idea to remove the duplicate respondents and sum their weights ? Will this lead to different results ?

So my initial data would look like this

> dt
   id weight v1 v2
1:  1     10  2  4
2:  2     11  2  4
3:  3     12  2  4
4:  4     13  3  5
5:  5     14  3  5
6:  6     15  3  5

And since respondents 1,2,3 are the same, and respondents 4,5,6 are the same i would end up with this

> dt
   id weight v1 v2
1:  1     33  2  4
2:  2     42  3  5
  • $\begingroup$ By adding their weight, do you mean to consider weight as a feature/characteristic ? $\endgroup$
    – AshOfFire
    May 15, 2018 at 8:32
  • $\begingroup$ no i mean summing their weights. so weight is also a characteristic, but because some of the respondents will be removed, i take into account their absence by summing their weight $\endgroup$
    – quant
    May 15, 2018 at 8:40
  • $\begingroup$ @AshOfFire updated the question. i hope it is more clear now $\endgroup$
    – quant
    May 15, 2018 at 8:44

1 Answer 1


With weighted linear regression, it is exactly the same, as the expression for the loss function is a sum of weights multiplied by errors in the prediction. This works, of course, for other methods with loss functions, such as logistic regression and neural networks. This is due to the fact that the loss function is linear with respect to the weights. As you save memory, it is totally recommendable.

With other methods, you should check if the criteria for choosing parameters or method is linear or not with respect to the weights. If not, you should not do it (to me it doesn't make sense that methods are not linear with respect to weights, but there might be a case where this happens).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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