Hello all, I am new to STATA and trying to loop replace function. Is there a way to improve my code?
replace d_20180706 = 25 if d_20180706 == 1
replace d_20191001 = 30 if d_20191001 == 1
replace d_20180823 = 25 if d_20180823 == 1
replace d_20191002 = 30 if d_20191002 == 1
replace d_20180924 = 10 if d_20180924 == 1
replace d_20190601 = 25 if d_20190601 == 1
replace d_20190901 = 15 if d_20190901 == 1
Thanks a lot for the help.
Related Posts with Looping replace function
Reading image properties such as GPS and date takenHi everyone, I was wondering if there is a way to read photo/ image properties such as date taken, d…
Stationarity, Markov switchingHi everyone, I was trying to model times series with markov switching regimes. Preliminarily, do I n…
Out of sample estimation following xtdpdgmmStata throws a 301 error (last estimates not found) whenever I try to use estimates from a dynamic m…
Shifting observations across rowsHello, I am fairly new to Stata and am having trouble even starting on this problem. I am working wi…
Identifying missing Data & Interpolation of Panel DataHello, I've created a dataset of 30 countries over 30 years for 29 different variables. For some of…
Subscribe to:
Post Comments (Atom)
0 Response to Looping replace function
Post a Comment