Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Disaggregating the values taken by a Stata variable


From   <[email protected]>
To   <[email protected]>
Subject   st: Disaggregating the values taken by a Stata variable
Date   Fri, 31 May 2013 11:21:58 +0000

Hi,

I would like to know if it is possible to assign more than one value to a Stata variable under the same condition. Here is my problem:

In my dataset, I have a variable called “economic_region”. I would like to:

1) assign sub-regions to each of these economic regions
2) assign Postal Codes (PC) or Forward Sortation Area (FSA: the first three characters of the PC) to each of these sub-regions (in order to be able to do a "many to one" match later).

In other words, I would like to disaggregate these economic regions. Note that I know the list of the sub-regions for a given economic region and I also know the list of the FSA for a given sub-region, but this information is not in my dataset and I would like to include it. If I had the reverse problem (aggregation), it would be easy for me to solve. For ex, suppose that I wanted to create the economic region named Ottawa from three sub-regions: Nepean, Kanata, Rockland, it wouldbe:

gen str10 economic_region = ”Ottawa” if sub_region == “Nepean” | sub_region == “Kanata” | sub_region == “Rockland”

But, I want to disaggregate instead. I have the economic region named Ottawa and I want to create three sub-regions from it: Nepean, Kanata, Rockland. I thought I could do that by assigning multiple values to the variable called sub-region. I know how to assign more than one value to a Stata variable under different conditions, but I don’t know how to assign more than one value to a Stata variable under the same condition (or if this is even possible!).  Can you tell me if it is possible to do that in Stata and how? I would appreciate your help on this matter.

Best,
Ruolz.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index