expand 3 if services == "ALL"
bysort customer (services) :
replace services = word("1DA 2DA 3DS", _n) if services == "ALL"
Nick
[email protected]
MITRA PINAKI
> I have a data set like the following:
> Customer Services Rate
> xx1 1DA .50
> xx1 2DA .75
> xx2 ALL .30
> xx3 2DA .40
> xx3 3DS .60
> and so on.
>
> The maximum combination of services can be (1DA, 2DA, 3DS)
> and when the
> services is "ALL", I need the data set to be expanded in 1DA, 2DA, 3DS
> with the same rate. So for customer xx2, it needs to look like:
>
> Customer Services Rate
> xx2 1DA .30
> xx2 2DA .30
> xx2 3DS .30
> while all other information for other customers remains same.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/