Change a tax law parameter - Example 2

/* Example 2 - Change a tax law parameter */ libname t "taxpayer-data-files"; %INCLUDE "taxcalc.sas"; data; set t.puf_2004; weight = S006/100; tax0 = e10300; /* Store taxpayer value */ %INIT; /* Initialize tax parameters */ _amex(2004) = 3100; /* Set personal exemption for Base Law - same as */ /* initialized value */ %COMP; /* Calculate tax liability under base law */ tax1 = c10300; _amex(2004) = 4100; /* Set personal exemption for proposal */ %COMP; /* Compute tax liability with new exemption */ tax2 = c10300; run; proc means mean; var tax0 tax1 tax2; weight weight; run;

Notes

In this example we change the value of the personal exemption for 2004 from $3,100 to $4,100 and calculate the change in liability assuming no behavioral response

Tax law parameters are defined and initialized in the %INIT macro. You would consult the source code of %INIT for the parameter names and historic values. In this case the personal exemptions over time are held in an array _amex(1993:2008). All TAXCALC internal variable names start with an underscore to avoid collisions with your code.

We have to set _amex(2004) to the historic value for every record - %INIT only initializes once per data step run. In this case we change the exemption value every time a record is read, so that won't be sufficient.

The base law revenue is calculated with the %COMP macro, which fills in a large number of intermediate tax calculations in addition to c10300, which is tax after credits.

We can change the personal exemption to $4,100 and recalculate the tax by inserting %COMP again. This writes over the original calculation of c10300, which is the reason it was saved as tax1. Since we don't explicitly save the intermediate values of the base case, they are lost.

The separation of initialization and computation saves us from rereading the entire dataset, while providing great flexibility for modifications of the calculation without editing taxcalc.sas. Nevertheless, you might want to modify the source code, which is generally straightforward.