Installation of Taxsim

The staticly linked taxsimtest AMD64 binary executable file is available at one of these URLs: Download the file and copy it to someplace on your system, perhaps in the default executable path for convenience. You should rename it taxsim.exe (Windows) or taxsim (others) to correspond to the example below but other name changes may cause problems..

Testing

Prepare a simple ASCII test file in csv format - we will call it txpydata.raw:

mstat,year,ltcg
2,1970,100000

and submit it to taxsim.exe:

taxsimtest < txpydata.raw

You should receive a 2-line csv file in reply. If not, check the existence and permissions (Linux and OSX) on the executable file.

For the WASM version the command would be:

cat txpydata.raw | node -e "requires(taxsim.js)"

Format of submissions

Taxsim expects to read a csv file with taxpayer data. The first row will be the variable names as documented at the taxsim home page and each of the remaining rows corresponds to a tax return.

In addition to the taxpayer characteristic variables two control variables are available.

Additional Controls

If the default marginal tax rate calculation or level of detail is not to your liking, it is possible to change either with additional variables.

These values of mtr affect the marginal tax calculation:

These values of idtl affect the output level:

Here is an example file asking for the full (with many intermediate calculations) with several different marginal tax rates:

taxsimid,mstat,year,ltcg,mtr,idtl 1,2,1970,100000,11,2 1,2,1970,100000,70,2 1,2,1970,100000,85,2 1,2,1970,100000,86,2 note that idtl can't vary across observations.

Problems

The most likely problem is:

taxsimtest: not found


or something similar. Other problems would be non-decimal characters in the data (such as missing value codes) or non-ascii data. Check your data in notepad or similar. If there are data problems, an explicit error message will be output to the standard output and execution will cease. The FAQwill answer many common questions.

Source Code

Unlike the programs of professional programmers, taxsimtest.for has no dependencies, uses no non-standard libraries and will compile on any computer with any fortran compiler with a single command such as: gfortran taxsim.f -o taxsim.exe If you need source code I can supply that. It is a single f90 file.

Example using Taxsim with SAS


data txpydata;
input taxsimid mstat year ltcg;
datalines;
1 2 1970 100000
;
run;

filename txpydata "txpydata.csv";
filename results  "results.csv" ;
x "rm results.csv"

proc export outfile="txpydata.csv" dbms=csv replace;
run;

x taxsim.exe < txpydata.csv > results.csv;

proc import datafile="results.csv" out=results dbms=csv;
run;

proc print data=results; run;
You will need to replace "rm" with "del" on a Windows system.
Last modified 17 June 2024 by feenberg@nber.org