Dear Stata users,
I would like to execute the following command through a loop:
replace q33_1=.a if q29_1 ==.a
replace q33_2=.a if q29_2 ==.a
replace q33_3=.a if q29_3 ==.a
replace q33_4=.a if q29_4 ==.a
replace q33_5=.a if q29_5 ==.a
I already tried with :
forvalues v =1(1)5{
replace q33_`v'=.a if q29_`v'==.a
}
But it's not working. Thank you for your help.
Best,
Jules
Related Posts with Replacing values using a loop
One unique value label for several variables: how changing that automatically ?Hi everyone, I have a big dataset which i have for hundreds variables an unique label value. Here i…
getting transformed variables in reghdfeHello everyone, I have a problem with reghdfe and reg2hdfe I hope someone here can help me with. I …
stan in stataGood day everyone in the house, please I need someone to guide me on how I can download stan in stat…
Please Help Convert Country CodeGood day , I am working on trade data set from BACI ( about 3 million observations )which reports co…
Reshape: (note: it20180624 not found)Hello all, I am trying to reshape my data from wide format to long format the variable I am trying t…
Subscribe to:
Post Comments (Atom)
0 Response to Replacing values using a loop
Post a Comment