In R, I can run another R script using
source("script.R")
How can I do the same in Stata?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Stata, there are two types of scripts:
and
The primary distinction is that to execute the do-file, you need to
doit orrunit:shows the output, and
suppresses the output.
The automatically loaded do-files, as the name implies, are loaded automatically. When you type
Stata will first look for the program
blahin its memory. If it is not there, it will look for fileblah.adoin the subdirectories identified in itsadopaththat by default includes Stata’s own directories, as well as the current directory (typeadopathto find out more, if you are interested). If it finds thisblah.ado, it will (1) make sure it hasprogram define blahinside it, and (2) try to execute this program with whatever arguments you supplied (blah1 blah2). If it fails to find the fileblah.adoanywhere, it will issue an error message: