Hi, I have been trying to loop over some file names.
I have something like this:
foreach s of num 2007/2015{
clear all
use "$path/Matricula Universitaria/`s'_1C.dta", clear
merge m:m mrun using "$path/Matricula Universitaria/`s+1'_2A.dta", keep(match master) force
}
For instance, I want to match the database 2007_1C with the 2008_1A but I can't get the `s+1' to work. If I do that, it merges the 2007_1C with the 2007_1A
If I write
merge m:m mrun using "$path/Matricula Universitaria/`s'+1_2A.dta", keep(match master) force
I get the following error message:
file C:.../Matricula Universitaria/2007+1_2A.dta not found
Any help is welcome! Thanks
Related Posts with Loop over file names
How do I interpret interaction effects in a log-level regression model?My model: log(y)=β0 + β1x1 + β2log(x2) + β3x1log(x2). The x1 variable is endogenous and I instrume…
Mlabel command to label datapointsHello I am trying to label the datapoints in the graph below. I want to mark the number of machines …
Pseudo R-squareds for melogitHi, Are there any packages to estimate (several) pseudo R-squareds after melogit? - I have noted t…
Evaluating a policy *expansion* using Difference in DifferenceDear All: I am writing to ask for a Difference-in-Difference question. Usually in a standard DiD s…
How to count the number of observations at the min and max value?Given the data set, Find the average education level in the sample. What are the lowest and highest …
Subscribe to:
Post Comments (Atom)
0 Response to Loop over file names
Post a Comment