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
Calculating Average pay gapHello, I wanted to calculate the average pay gap between workers in my data set. How do i do that? …
Does Keep command work with non numeric variables?Hello, I am quite new to stata so sorry if this has been answered before, but I could not find it v…
using non-standard schemes on locked-down computersI'm using a server for which I do not have administrator rights, and thus must direct Stata to look …
transparency in points on graphHi, I know there is an option to add transparency to data on a scatter plot in stata 15 but is it p…
How do you measure the amount of countries that have values for at least one year with panel data?Dear Statlisters, Probably this question is asked before, but I could not find clear answer. I am …
Subscribe to:
Post Comments (Atom)
0 Response to Multiple line -if- conditional on variable
Post a Comment