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
Error Code (199)Hello Everyone, I'm Kousay, and I'm conducting research on the impact of the pandemic on the firm fi…
Multiple stored results from tabstat and esttabDear All, I am running different summary statistics based on the if condition. Then I am trying to …
Fitting Large, Multidimensional Tables to a Word DocumentHi all - hoping folks can help me manage a large multi-dimensional table that I need to output to a …
Delete panel data observation if price i below certain thresholdHi, I'm working with a panel data set that consists of daily stock prices. I would like to create a…
Preparing Panel Data with repeated time values within panel (xtset)Hey everyone, I am working with survey data (PSID) and am currently facing some difficulties regardi…
Subscribe to:
Post Comments (Atom)
0 Response to Looping replace function
Post a Comment