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)
Regression for state-wide daily=data with fixed population percentageHello, So I have data set up as such (sample data that I just made up): Code: * Example generated b…
Regression for state-wide daily data with fixed population percentage within statesHello, So I have data set up as such (sample data that I just made up): Code: * Example generated b…
Reshaping my datasetHello, I am having trouble reshaping my dataset. I only want two columns: descriptive statistics (i…
how to draw multi-classification ROC curve use statahello everyone ! i want to test the diagnostic value of a b c d. and the gold standard is multi-clas…
Why Stata graphs have different margins?Dear Statalists, I am plotting my estimated coefficients and its confidence intervals. But I found t…
Subscribe to:
Post Comments (Atom)
0 Response to Beginner User: invalid variable r(198)
Post a Comment