-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running Tax-Calculator from Stata #2273
Comments
If he has taxcalc on his local computer, this is an easy .ado file to
write. It is just 3 steps:
outsheet var1...varn using data
! /path/to/taxcalc ...
insheet using results
Have him call if he needs help.
Dan
617-863-9343
…On Mon, 25 Mar 2019, Max Ghenis wrote:
I was speaking to a poverty researcher who works primarily in Stata, and for
tax calculation exports the file to CSV, then runs taxcalc via the CLI, then
re-imports the result to Stata. Is there a simpler way I can recommend? I
don't have Stata to test myself, but given its high usage among policy
researchers it might be good to have some instructions like "taxcalc for
Stata users."
?
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the
thread.[AHvQVYKSIVZwpeEmWW6EnTT0weojJOurks5vaRrdgaJpZM4cIRuB.gif]
|
@feenberg, thanks for your helpful suggestion about how to run the Tax-Calculator
The command-line tool is called
|
@MaxGhenis, Was Dan's suggestion helpful to the poverty researcher you were talking with? |
Hi @feenberg, Thanks for your response, and thanks @MaxGhenis for posting after our conversation. Dan, you have helped me before on Taxsim issues, so it's nice to hear from you again. Sorry I am slow to respond (job market flyout!). So, yes, the shell command Dan suggests is what I usually do, though I think the problem I am having is that I am using an institutional computer and the Anaconda installation did not set up the environment such that I can call tc from outside of the Anaconda prompt. Does that make sense? I can manually interact with the Windows command prompt to establish the environment within the Taxcalc folder and then call tc from there, but I think I would need a script to do something like this from Stata. Probably, the solution is to go back to my admin and set up Anaconda again so that I can run this more easily. Thanks for the help, I will update when I get it to run successfully. Regards, |
On Thu, 28 Mar 2019, Robert Paul Hartley wrote:
Hi @feenberg,
Thanks for your response, and thanks @MaxGhenis for posting after our
conversation. Dan, you have helped me before on Taxsim issues, so it's nice
to hear from you again.
Sorry I am slow to respond (job market flyout!). So, yes, the shell command
Dan suggests is what I usually do, though I think the problem I am having is
that I am using an institutional computer and the Anaconda installation did
not set up the environment such that I can call tc from outside of the
Anaconda prompt. Does that make sense? I can manually interact with the
Is tc in the executable path? If not, then could modify the path within
the Anaconda environment to include the directory with tc, or much easier
you could specify the full path to the tc executable.
Or is it that in the Anaconda environment there is a missing library, so
that tc won't link? That can also be addressed, by adding to the load
library path.
Dan
… Windows command prompt to establish the environment within the Taxcalc
folder and then call tc from there, but I think I would need a script to do
something like this from Stata. Probably, the solution is to go back to my
admin and set up Anaconda again so that I can run this more easily.
Thanks for the help, I will update when I get it to run successfully.
Regards,
Rob
?
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the
thread.[AHvQVdZq8aql7sj_w6fkWADs1D1oZdTaks5vbMhfgaJpZM4cIRuB.gif]
|
@rHrtly and then @feenberg said:
Don't know about how Anaconda works on Windows, but on both Mac
@rHrtly, Please report back on your experience as we are handicapped |
Hi @martinholmer and @feenberg, I have tried using full paths to my input files and the tc executable file. I think a helpful example is, as mentioned, I cannot run tc from the command prompt unless I establish the anaconda environment first. I followed this sequence based on the contributor guide: From your command line or terminal, navigate to your local Tax-Calculator directory. This is the only way I've gotten tc to work without calling it from the Anaconda prompt. So, again, my guess is that I need an admin to change something about my Anaconda installation in order for the proper library paths to be found? |
Probably not. My understanding is that Anaconda works fundamentally different on Windows from the way it works on Mac and Linux. It is so cumbersome under Windows, that the first developers of Tax-Calculator (according to what I've heard) had to trade-in their Windows computers for Mac computers in order to be productive in their development work. |
So, I had some time to revisit this and received some guidance from a friend, and here is the solution we found: apparently all I needed was to add Python/Conda to my path in command prompt, and now I can shell out from Stata easily.
Now, in Stata I can use:
where the data file and associated reform or other files are located within the Stata current working directory. Stata runs the shell command, and waits until it is finished, then proceeds with the next command, which is perfect for what I was wanting. |
@rHrtly described how to run the Tax-Calculator Thanks for sharing the answer to the question posed in issue #2273. So, it seems you need to add two directories to the Windows path, right? I don't have any Stata experience, is the |
I think that's right, @martinholmer. And in Stata, if you want to invoke an operating system command, you would precede the command with either "shell" as I did, or "!" as @feenberg posted earlier. Here are the detailed options from Stata's help file:
|
@rHrtly, Thanks for answering my questions. |
Thanks @martinholmer! and thank you @MaxGhenis for posting the question here. |
I was speaking to a poverty researcher who works primarily in Stata, and for tax calculation exports the file to CSV, then runs taxcalc via the CLI, then re-imports the result to Stata. Is there a simpler way I can recommend? I don't have Stata to test myself, but given its high usage among policy researchers it might be good to have some instructions like "taxcalc for Stata users."
The text was updated successfully, but these errors were encountered: