A SAS macro to invoke the TAXSIM server
TAXSIM is a network service available via plain ftp for calculating federal and state income tax liabilities from survey data. Notice that it is a service, and not a program. Your SAS job uploads the data, and downloads the results. Because SAS includes a functioning ftp client invoked by the "filename" statement, it is straigtforward to write a 50 line SAS macro to invoke the TAXSIM server. With the macro the process is handled inline with the SAS code and no user intervention is required. With a good decent internet connection you should be able to run 10,000 records/minute.
Step-1 Test ftp
You should ftp to make sure ftp is not blocked at your firewall.
Step-2 Obtain the macrotaxsim-macro.sas macro is available as http://www.nber.org/taxsim/taxsim-calc9/macro.sas. Be sure to examine the macro and understand what it is doing. You can use your own copy or It may be dynamically included in your source each time it is used:
filename taxsim URL "http://www.nber.org/taxsim-calc9/macro.sas"; %inc taxsim
Step 3. Running TAXSIM
You will need a SAS file with exactly the same 22 variables as are documented on Taxsim web page. The variable names are shown below in the example, in the same order as they are listed on that web page. You invoke taxsim with %taxsim:
%taxsim(in,out);where "in" and "out" are filenames for the input and output files in sas binary format.
That's it. You don't really need any more information. You only need to create the file described on the Taxsim web page. But please follow the instructions there carefully. If there are errors in the file, such as negative wages or out of bounds state codes you should get a message in the sas log and a partially filled "out" file.
Step 4. Customization
If the default marginal tax rate calculation, level of detail or tax law is not to your liking, it is possible to change change them with the optional arguments. The full macro call is:
The choices for the marginal tax (mtr) calculation are:
The choices for detail (idtl) are:
The choices for plan and planval are detailed here.
You are likely to want to change the integration with SAS, which will mean copying it to a local directory and editing it to suite your requirementss. The code is very easy to understand and change - don't hesitate to try this.
Although this is quite a simple SAS macro, debugging problems is still a challenge. In most cases it is easier to solve problems by editing the macro into straight SAS code, and running without the macro. Before reporting communication problems, please add the "debug" option on each of the filename statements in the macro, rerun, and send the log file to me.
This provides detailed results and calculates the marginal rate for long term capital gains for this very well off individual.
Last modified 10 July 2009