What is wrong with commands in this Stata do-file? I am trying to open all batch files that are in separate sub-folders named Batch1-Batch2-..... to Batch32. These subfolders are in Output folder.
Also is there any way to append them using loops in Stata rather than doing one by one?
clear all
gl outputs "E:\Outputs"
forvalues i = 1/32 {
import delimited "$outputs/Batch`i'/batchfile.tab", clear
tempfile batchfile_`i'
save `batchfile_`i''
}
Related Posts with Loops to switch between different sub-folders
How to get the significance level stars for the coefficients in thresholdreg cammand for (Hansen, 2000) Threshold Estimation __________________________________________________ ____________________ Thres…
Generating a New Variable based on Conditional IF StatementsHello STATA Experts: I am trying to create a new variable based on the existence of certain conditio…
Rosenbaum BoundsHi, I have conducted propensity score matching using the WHO-5 Mental Health Index as my outcome va…
Assigning value "1" to a dummy variable when another variable reaches its max, for each individual across choice alternativesI have a dataset of about 3800 observations. This dataset is in long form: I have about 760 individu…
Alternatives to margins command (too slow)Hi, I have a simple program that estimates that regresses an outcome on (a) event-time dummies (i.e…
Subscribe to:
Post Comments (Atom)
0 Response to Loops to switch between different sub-folders
Post a Comment