I'm having difficulties to save the output of my regression. Stata is supposed to save the file as "output.dta" in the defined directory, however the file is not saved in this folder (and also nowhere else on my PC). Here is the final piece of code, where I want it to be saved:
if (`counter'==1) {
save "C:\Users\Milla\Code\output", replace
local counter = `counter' + 1
}
if (`counter'!=1) {
cap append using "C:\Users\Milla\Code\output"
duplicates drop *, force
cap save "C:\Users\Milla\Code\output", replace
}
Does anyone have an idea why could this happen? The code runs well and throws no errors or warnings. But it also doesn't say "output.dta is saved" as it normally does, when one saves anything in Stata.
Thanks ahead and best regards, Milla
savewithin the loop), is because you have usedcaptureto suppress all the output from yourappendandsavecommands within the loop. Try removing thecapfrom these commands and rerunning and see what Stata tells you. - user4690969counter? You say that output.dta doesn't exist anywhere on the computer, so ifcounter != 1when you run this, it will try toappendusing a non-existent file and throw an r(601) file not found error. You precede theappendwithcapture, so any errors will be suppressed.Although I suppose it should stillsavethe file on the secondsavecommand. - ander2ed