Is there a code with which i can replace certain areas of a larger code while only one line
For example, i have:
import excel "D_EU_Austria.xlsx", sheet("Price History")
gen D_EU_Austria = ln(Total_Return_Gross_Unh / Total_Return_Gross_Unh[_n-1])
keep D_EU_Austria Date
drop if D_EU_Austria == 0
drop if D_EU_Austria == .
save "D_EU_Austria.dta", replace
Can I replace every instance of D_EU_Austria in my code with something else by writing it only once? I have to repeat this entire code for 20 countries.
Thank you so much (first time poster)
Related Posts with Replacing pieces of code with one line
Fixed Effects Regression - Binary Variable Can Only Equal 1 OnceDear all, I am working with a dataset looking at employee departures across a group of firms. The d…
Run regression separately for several periodsWhat are some reasons that can justify the necessity to run regressions after dividing the data into…
Reshape or transposeHi all, I have a question that I assume is incredibly simple that I just can't figure out: I have da…
Using absorb to create dummy variablesHello I have firm-pair-quarter panel data where firm-pairs are not repeated or duplicated (i.e., if…
Questions on the validity of a dynamic model of the Second-Order [using XTABOND2 command] My data is structured as follows Code: * Example generated by -dataex-. For more info, type help …
Subscribe to:
Post Comments (Atom)
0 Response to Replacing pieces of code with one line
Post a Comment