AllenDowney / ThinkStats2

Text and supporting code for Think Stats, 2nd Edition
http://allendowney.github.io/ThinkStats2/
GNU General Public License v3.0
4.03k stars 11.31k forks source link

Sampling Weights with DiffMeansPermute? #107

Closed gmrwvu closed 6 years ago

gmrwvu commented 6 years ago

Is it necessary to consider sampling weights when using the DiffMeansPermute class? Or, are sampling weights really only a consideration in coefficient calculation such as in linear regression?

AllenDowney commented 6 years ago

Yes, it would be better to use sampling weights to resample before each iteration of the permutation test. But at this point in the book, we haven't done weighted resampling yet, right?

On Sat, May 5, 2018 at 6:33 PM, George Ray notifications@github.com wrote:

Is it necessary to consider sampling weights when using the DiffMeansPermute class? Or, are sampling weights really only a consideration in coefficient calculation such as in linear regression?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/107, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy37ZXiO2B1QVetphbmWEW0OhYvkBh2ks5tviifgaJpZM4Tz0Sa .

gmrwvu commented 6 years ago

You are correct. There seems to be several types of weights - one about how many people each person represents, and others like dweights in the European Social Survey. I have your algorithm for applying the first kind. The dweights seem to be deceptively simple: just multiple the dweight by the attribute you are analyzing or is there a more complex action to take with them?