Comments (4)
from c-tam.
This is a valid concern. Dan has also brought up this issue before. Records with positive predictors are a lot more likely to be imputed, while not all of the predictors are available in the CPS dataset. With regard to income, lower income people are much more likely to be imputed than higher income people and on top of that, maybe they are imputed at a higher rate than they 'should be'. Dan has asked Robert Moffitt whether the participation should be imputed by income range according to the estimated probability. His view is, in short, depending on what you want to do.
So I have two questions. First, do you have a 'correct' correlation in mind for income and participation? Or the goal is simply to reserve the fuzziness? Second, is the correlation particularly important your project?
Anyways, I do think it's worthwhile to add on more options for imputing procedure. Your solution is sensible and easy to implement. The caveat, from my perspective, is how to factor in the records weight. CPS weights are population/family/household counts. If we simply implement the weighted sum in the argument p
, the weight of each record could confound the actual probability.
from c-tam.
First, do you have a 'correct' correlation in mind for income and participation? Or the goal is simply to reserve the fuzziness? Second, is the correlation particularly important your project?
A simple example could be modeling the after-tax income distributional impact of repealing SNAP. The current data overstates SNAP participation among low-income HHs, and understates it among higher-income HHs. So SNAP repeal would look more regressive than it actually is. Other reforms like shifting the SNAP budget to UBI would also look overly regressive.
The caveat, from my perspective, is how to factor in the records weight.
Yes that's trickier, and I think would require a looping budget logic rather than numpy.random.choice
. I asked for ideas in this SO question. I think it requires adding households one at a time according to the probabilities, until you can't add any more.
from c-tam.
Here's the code from my answer to the SO question:
def weighted_budgeted_random_sample(df, budget):
""" Produce a weighted budgeted random sample.
Args:
df: DataFrame with columns for `prob` and `weight`.
budget: Total weight budget.
Returns:
List of index values of df that constitute the sample.
"""
ids = []
total = 0
while total < budget:
remaining = budget - total
df = df[df.weight <= remaining]
# Stop if there are no records with small enough weight.
if df.shape[0] == 0:
break
# Select one record.
selection = random.choice(df.index, p=(df.prob / df.prob.sum()))
total += df.loc[selection].weight
df.drop(selection, inplace=True)
ids.append(selection)
return ids
So it'd be called as weighted_budgeted_random_sample(df, budget=total_snap_participation)
where df
had prob
as predicted by the regression model, and weight=s006
.
from c-tam.
Related Issues (20)
- What share of veteran benefits is cash? HOT 2
- Can this project upgrade to Python 3.6? HOT 2
- README seems to be outdated HOT 3
- Why is TANF administrative total only $9.6B? HOT 5
- Why is housing_ben only $2.1B in CPS Tax-Calculator data? HOT 2
- Some tax units have extremely high values of Medicaid and Medicare HOT 27
- How CBO handles imputing benefits HOT 16
- Confirm that high values of vet_ben are pensions from generals HOT 35
- Add Citizenship indicator HOT 9
- Expand the database to include 2016 CPS HOT 5
- Studies on misreported benefits
- Join the Policy Simulation Library? HOT 1
- FYI: Comparison to Stanford's California Poverty Measure HOT 3
- Add National School Lunch Program (NSLP)?
- Add Low-Income Heating and Energy Assistance Program (LIHEAP)?
- Does the Social Security MTR include income limits on benefits (especially SSDI)? HOT 3
- Add CHIP
- Use UI calculator from Ganong et al
- Incorporate TRIM3 logic
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c-tam.