Hi All-
Each time I run the code below, I receive an invalid 'data' r(198) response from STATA. I am using the updated STATA 17. What am I doing wrong? How can I fix this?
*Import and append all data from dta
*set the local space where you saved the dta file
global all_dta "/Users/emmaposey/Downloads/dta"
cd "$all_dta"
*import and append all data from dta
* Create a temp file to append all files to. This will become the main dataset.
tempfile data
save 'data', emptyok
*import all datasets and append:
local filenames : dir "${all_dta}" files "*.dta"
foreach f of local filenames {
use `"`f'"', clear // import file
gen source_dta = `"`f'"' // create variable with name file
}
Related Posts with Beginner User: invalid variable r(198)
Interpreting stata output with log dependent variable and % independent variablesHello stata users, Hope you are doing well. I have a question regarding interpreting stata output i…
Graphing Medians Panel DataHello, I'd like to graph the median values of a variable. The data I have looks like this, and I wou…
Using substring functions in Stata 16.1Dear Statalist, I have a string variable "comment" stored as "strL" that contains a mix of numbers…
Adding fixed effects in esttab using estaddHi all, I've run a few regressions and am trying to add rows indicating the presence of fixed effec…
re-formulate a functionHello everyone, I have this equation Code: g=exp(1.546776)*(x/(1-x)^(0.4314782)*y^(1-0.4314782)-exp…
Subscribe to:
Post Comments (Atom)
0 Response to Beginner User: invalid variable r(198)
Post a Comment