Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: how to create dummy for unique values across variables


From   Ana Gabriela Guerrero Serdan <ag_guerreroserdan@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: how to create dummy for unique values across variables
Date   Mon, 22 Oct 2007 02:59:21 -0700 (PDT)

Dear all, 

Im sorry if this question seems too obvious but I have
looked into the data manegement manual and the FAQ and
havent find any solution. I have data on victimes. The
weapons used are reported. Var cau*1 refers to the
type of aggression and cau1* to the weapon used. "-" 
means no information. 

For some victimes there are two or more types of
aggression reported as well as type of weapon, up to
nine types. Im only including a few below. 

 Im trying to isolate cases in which only one weapon
is being used by creating a variable (dummy) that will
indicate that that victim was only agressed by only
that type of weapon. 

So I want to create a var for unique values across
variables.  

My data looks like this:

. list  victim incident cau11 cau12 cau21 cau22 
....
49711   d0096   Ground   Gunfire   Ground  Gunfire 
49713   d0097   Other      -        Other    - 
49712   d0097   -           -       -         -
49714   d0097   Ground   Gunfire      -       - 
49595   d0098   Ground   Bombs       -         - 
49596   d0098   Ground   Bombs       -         - 
49599   d0099   Ground   Gunfire     -       - 
49598   d0099   Ground   Gunfire     -        - 
49597   d0099   Ground   Gunfire     -         - 
49602  d0100   Ground    Gunfire   Ground   Bombs 
49603  d0100   Ground    Gunfire   Ground    Bombs 
49601 d0100   Ground     Gunfire   Ground    Bombs 

In this sample, all will be unique cases except the
last three victimes. 49602, 49603 and 49601. 

I have tried to create each dummy but its very time
consuming as I have to check for 9 causes and nine
sub-causes for thousands of obs. 

can anyone help? 

thanks, 

Gaby 
 



Gaby Guerrero Serdan 

Deparment of Economics
Royal Holloway, University of London
TW20 OEX
Egham, Surrey
England, UK
http://www.rhul.ac.uk/economics/About-Us/postgrads.html
http://www.flickr.com/photos/49939890@N00/

Tel: +44 7912657259

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index