Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: help on data manipulation


From   <[email protected]>
To   <[email protected]>
Subject   st: help on data manipulation
Date   Fri, 29 Jul 2005 14:21:01 -0400

Hello List,

     I have a data set like the following:

custnum    master      state
-----------------------------
712875     712875       TX
182579     712875       CA
376083     712875       FL
716228                  TN
604906     312456       IL
177414                  PA

I need to redefine "state" variable for customers "custnum" such that
when there is a master customer # "master", all customers under that
master will have the same state. For example, custnum 712875, 182579, &
376083 have master 712875 and when custnum="712875" & master="712875",
the state is "TX". So, the data needs to look like:

custnum    master      state
-----------------------------
712875     712875       TX
182579     712875       TX
376083     712875       TX
716228                  TN
604906     312456       IL
177414                  PA

Can anyone please help me with this?

Thank you.

Sincerely,
Pinaki Mitra


*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index