Reweighting (rake) in Python
Asked Answered
U

1

6

I'm looking for a python library for replace the rake function from "Survey", an R library (https://www.rdocumentation.org/packages/survey/versions/4.0/topics/rake)

I have found and try Quantipy, but the weights quality is poor compared to the weights generate with R on the same dataset. I have found PandaSurvey, but seems to not working correctly (and the documentation is very poor)

I am surprised not to find much on google on this subject. However, it is an essential function if you are working with polls. Python being a datascience language, it's surprising. But maybe I missed it.

Thank you very much!

Undertenant answered 16/9, 2020 at 9:53 Comment(1)
Would also be interested to hear responses to this.Sociolinguistics
T
1

I know it's an old post, but it may help others. I used IPFN library to calculate weight for my sample dataset based on a targeted population. I think it may suit your needs.

Tabina answered 28/4, 2023 at 12:2 Comment(1)
Welcome to SO Ash. This appears to be a useful answer but link only answers are subject to review and deletion. This is because links can go dead and SO prefers working examples so others can easily assess and validate your answer. Please consider updating your answer to include your sample data and the code you used. Many thanks.Ocarina

© 2022 - 2024 — McMap. All rights reserved.