I have (quite stupidly) have code of this type
if market=="a" {
replace o=1
replace e=1
replace state="w"
replace date="10/8/16"
}
I have this for about 600 markets and several statements inside so my do file stretches to over 9000 lines. I have now realized that the -if- does not work properly when conditioned on a specific value of a variable. Is there any quick way to implement a change for all of 600 market -if- conditions? Would be very grateful for some help!
Related Posts with Multiple line -if- conditional on variable
forvalues errorI keep getting a "varlist not allowed" error when I write my forvalues loop, but I copied the syntax…
Fixed Effects Regressions with Time and Individual Fixed EffectsHello, The following questions are to essentially check whether I am carrying out the correct econo…
How to count how many years of data each company has?Hello, I have a dataset that contains several executive's compensation infromation for each company.…
-moments2- updated on SSCThe single-program package -moments2- has been updated on SSC, thanks as usual to Kit Baum. Stata 8.…
Power analysis for spearman rhoHi, I want to conduct a power analysis for spearman, and reading some instructions I have been asked…
Subscribe to:
Post Comments (Atom)
0 Response to Multiple line -if- conditional on variable
Post a Comment