Statalist The Stata Listserver


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

RE: st: RE: pairwise dummy variables


From   Serguei Kaniovski <kaniovsk@wifo.ac.at>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: RE: pairwise dummy variables
Date   Wed, 03 May 2006 13:51:03 +0200

Thank you, but this is not quite what I need. I would like to compute the frequencies of occurrence of all possible pairs of the binary variable "vote". To begin with, for example, generate variables "vote_*" for each possible pair of "voters_id", such that that, e.g., "vote_12" takes the value "1" if "voters_id" both have "vote=1", else zero, or NA if one of the voters in not on the body.

body_id,voter_id,vote,vote_12,vote_13,vote_17,vote_19,vote_23,vote_27,vote_29,vote_37,vote_39,...
1,1,1,0,1,1,0,0,0,0,1,0
1,2,0,0,1,1,0,0,0,0,1,0
1,3,1,0,1,1,0,0,0,0,1,0
1,7,1,0,1,1,0,0,0,0,1,0
1,9,0,0,1,1,0,0,0,0,1,0
2,1,1,0,.,0,.,.,0,.,.,.
2,2,0,0,.,0,.,.,0,.,.,.
2,7,0,0,.,0,.,.,0,.,.,.

and so on.

Serguei
--
___________________________________________________________________

Austrian Institute of Economic Research (WIFO)

Name: Serguei Kaniovski P.O.Box 91
Tel.: +43-1-7982601-231 Arsenal Objekt 20
Fax: +43-1-7989386 1103 Vienna, Austria
Mail: Serguei.Kaniovski@wifo.ac.at

http://www.wifo.ac.at/Serguei.Kaniovski

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