The following commands are fickle, not reliable, working sometimes and not at others. I use a project file, containing the specific do file with the script I am trying to run.
I work on a PC.
global macro project1_data "C:\Users\...\Datasets"
display "${project1_data}"
use "${project1_data}mysamplingdata", clear
However, the code does not seem to register, and I am told:
use "${project1_data}mysamplingdata", clear
file mysampling.dta not found
r(601);
Also, when I type in:
cd "${project1_data}"
This gives me the current directory. The project file is in a different directory.
Do I need to modify the global macro script above because of that?
Thanks,
Saul
Related Posts with Global macro for a directory using project file
Generating a rate variable (number of events per year) using date and string variablesDear Statalist, I want to create a variable giving rate of exacerbations per year for each individu…
For loop in StataHi, I want to loop over 150 variables, which has the format like code_001, code_002, ....., code_150…
label & then encode - Assigning 2 or more values to same numberI have the following string variable that has 60 unique values. I want to assign Bureau Veritas Cert…
Interpreting coefficientsPlease can someone explain to me the meaning of the coefficients for this random effects GLS regress…
Adding highly correlated explanatory variablesHello, do we add explanatory variables that are highly correlated with the other explanatory variabl…
Subscribe to:
Post Comments (Atom)
0 Response to Global macro for a directory using project file
Post a Comment