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
Stochastic frontier analysis: How to choose between time-invariant and time-varying decay SFA? Hello everyone: I am working on estochastic frontier analysis in the context of data panel. What s…
How to unassign a variable?When I take the residual by using Code: predict adj, residuals Next time I need to rename the vari…
mediation effect and endogenousDear sir or madam: But I have some question about the mediation effect and endogenous: Is there a tr…
Multiple imputation convergence not achievedHi all, I'm trying to perform chained multiple imputations but get an error message about convergen…
nana …
Subscribe to:
Post Comments (Atom)
0 Response to Replacing values using a loop
Post a Comment