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
estadd scalar not appearing in output tableI am trying to create a regression output table with estout or esttab. I am running three regression…
panel data xtabs first and last occurrenceHello, I am new to the Stata community and was hoping for some help with panel data analysis. I hav…
Conditional coloring on a histogramHi, I would like to have a histogram when the coloring is, for example, red if the values are highe…
Multilevel Model with Individual fixed effectsHi Statalisters, I have a panel dataset with around 30,000 individuals observed for four years all …
Converting a variable to a quarterly dataHey there, I imported data which was formatted like Q12007 and then reshaped from wide to long, eli…
Subscribe to:
Post Comments (Atom)
0 Response to Multiple line -if- conditional on variable
Post a Comment