[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 <>
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

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? 



Gaby Guerrero Serdan 

Deparment of Economics
Royal Holloway, University of London
Egham, Surrey
England, UK

Tel: +44 7912657259

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
*   For searches and help try:

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