I put together an R program that will reweight any full-PUF-synthesis to hit a large number of targets.
In the initial run, I reweighted synthpop3 using 63 targets: 11 income ranges x 6 variables, less 3 targets that were not feasible because all records in the income range that had the variable of interest had only zero values for the variable (thus, no adjustment to the weights for those records could change the sum of weighted values).
Income ranges:
agi.ranges <- c(
"c00100 < 0",
"c00100 == 0",
"c00100 > 0 & c00100 <= 25e3",
"c00100 > 25e3 & c00100 <= 50e3",
"c00100 > 50e3 & c00100 <= 75e3",
"c00100 > 75e3 & c00100 <= 100e3",
"c00100 > 100e3 & c00100 <= 200e3",
"c00100 > 200e3 & c00100 <= 500e3",
"c00100 > 500e3 & c00100 <= 1e6",
"c00100 > 1e6 & c00100 <= 10e6",
"c00100 > 10e6 & c00100 <= Inf")
agi.ranges
Variables:
vars.to.target <- c("wt", "c00100", "e00200", "e00300", "e00650", "p23250")
Here are a few results for the puf, synthesis-before-reweighting, and synthesis-after-reweighting by income range, plus differences from puf and % differences. They seem fairly heartening to me. Tax before credits within 0.2% on the bottom line and close in most income ranges despite not being targeted.
Tomorrow, I will clean up the program, add some more targets, and push to github - it will be a program in the misc section of EvalWtdSyn. I will also put the relevant reweighted file and counterparts to synpuf, in case @feenberg can run it through the tax reform routine. And I will try to run it through some of the descriptive routines so we can see what kind of unintended side effects reweighting may have on non-targeted values.
I also show below a histogram of the adjustment factors for the weights. BTW, the optimization runs in about 29 seconds.
Weighted number of records by AGI range:

Sum of weighted AGI, in $ billions, by AGI range:

Sum of weighted wages, in $ billions, by AGI range:

Sum of weighted tax before credits, in $ billions, by AGI range:

Distribution of the weight adjustment factors:

I put together an R program that will reweight any full-PUF-synthesis to hit a large number of targets.
In the initial run, I reweighted synthpop3 using 63 targets: 11 income ranges x 6 variables, less 3 targets that were not feasible because all records in the income range that had the variable of interest had only zero values for the variable (thus, no adjustment to the weights for those records could change the sum of weighted values).
Income ranges:
Variables:
vars.to.target<- c("wt", "c00100", "e00200", "e00300", "e00650", "p23250")Here are a few results for the puf, synthesis-before-reweighting, and synthesis-after-reweighting by income range, plus differences from puf and % differences. They seem fairly heartening to me. Tax before credits within 0.2% on the bottom line and close in most income ranges despite not being targeted.
Tomorrow, I will clean up the program, add some more targets, and push to github - it will be a program in the misc section of EvalWtdSyn. I will also put the relevant reweighted file and counterparts to synpuf, in case @feenberg can run it through the tax reform routine. And I will try to run it through some of the descriptive routines so we can see what kind of unintended side effects reweighting may have on non-targeted values.
I also show below a histogram of the adjustment factors for the weights. BTW, the optimization runs in about 29 seconds.
Weighted number of records by AGI range:
Sum of weighted AGI, in $ billions, by AGI range:
Sum of weighted wages, in $ billions, by AGI range:
Sum of weighted tax before credits, in $ billions, by AGI range:
Distribution of the weight adjustment factors: