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
Storing and accessing output of multiple estimation commands within programI've defined a program that generates random data and calls two estimation commands: reg and ppml. I…
GSEM mediation: Limitations in assessing model fitGreetings, I'm running Stata 15.1 on OSX and working with cross-sectional survey data. I'm trying t…
Setting up dataset for rds_networkHi, I need to create the respondent-driven sampling variables identifying recruits from two variabl…
How to do k-fold cross-validation on bayesian model?Hello, I wirte a bayesian model, and I want to do cross-validation on the model. More specifically, …
Spatial Panel Model: How use W matrix when is defined by user?Hi All This is my first post but I have learnt a lot from this forum in previous years. I am tryin…
Subscribe to:
Post Comments (Atom)
0 Response to Replacing pieces of code with one line
Post a Comment