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]

Re: st: Dummy variable transformation replacing missing data


From   Ronnie Babigumira <[email protected]>
To   [email protected]
Subject   Re: st: Dummy variable transformation replacing missing data
Date   Mon, 11 Jun 2012 15:13:40 +0200

This might be helpful

http://www.stata.com/support/faqs/data/missing.html 

-- 
010100100110111101101110011011100110100101100101




On Monday, June 11, 2012 at 2:54 PM, Joe Dreyfus wrote:

> Hi Statalist,
> 
> I have the following data.
> 
> id 
> t
> x
> z
> y
> 
> 1
> 1
> 1
> .
> .
> .
> 
> 2
> 1
> 2
> 1
> 0
> 0
> 
> 3
> 1
> 3
> .
> .
> .
> 
> 
> 
> 
> 
> 
> 
> 
> 4
> 2
> 1
> 0
> 1
> 0
> 
> 5
> 2
> 2
> .
> .
> .
> 
> 6
> 2
> 3
> .
> .
> .
> 
> 7
> 2
> 4
> .
> .
> .
> 
> 8
> 2
> 5
> .
> .
> .
> 
> 
> 
> 
> 
> 
> 
> 
> 9
> 3
> 1
> .
> .
> .
> 
> 10
> 3
> 2
> 0
> 0
> 1
> 
> 11
> 3
> 3
> .
> .
> .
> 
> 12
> 3
> 4
> .
> .
> .
> 
> 13
> 3
> 5
> .
> .
> .
> 
> 14
> 3
> 6
> .
> .
> .
> 
> 
> 
> 
> 
> And would like to transform the data as follows:
> 
> id 
> t
> x
> z
> y
> x'
> z'
> y'
> 
> 1
> 1
> 1
> .
> .
> .
> 1
> 0
> 0
> 
> 2
> 1
> 2
> 1
> 0
> 0
> 1
> 0
> 0
> 
> 3
> 1
> 3
> .
> .
> .
> 1
> 0
> 0
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 4
> 2
> 1
> 0
> 1
> 0
> 0
> 1
> 0
> 
> 5
> 2
> 2
> .
> .
> .
> 0
> 1
> 0
> 
> 6
> 2
> 3
> .
> .
> .
> 0
> 1
> 0
> 
> 7
> 2
> 4
> .
> .
> .
> 0
> 1
> 0
> 
> 8
> 2
> 5
> .
> .
> .
> 0
> 1
> 0
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 9
> 3
> 1
> .
> .
> .
> 1
> 0
> 1
> 
> 10
> 3
> 2
> 0
> 0
> 1
> 1
> 0
> 1
> 
> 11
> 3
> 3
> .
> .
> .
> 1
> 0
> 1
> 
> 12
> 3
> 4
> .
> .
> .
> 1
> 0
> 1
> 
> 13
> 3
> 5
> .
> .
> .
> 1
> 0
> 1
> 
> 14
> 3
> 6
> .
> .
> .
> 1
> 0
> 1
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> The time period where the indicator is on is not relevant. I just need to know how to transform the variable so that if it is swtiched on in one time period it is transformed to be switched on for all time periods. 
> 
> 
> Thanks in advance!
> 
> Joe 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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