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 <[email protected]>
To   [email protected]
Subject   RE: st: RE: pairwise dummy variables
Date   Wed, 03 May 2006 15:07:40 +0200

Nick, that you it works. Just a simple follow-up question: I have a binary variable "binvar" with n observations. I would like to compute the sums of the i-th and j-th element of "binvar", and put these into separate variables named "sum_i_j" using a double loop:

forval i=1/n {
local I=`i'+1
forval j=`I'/n {
...
gen byte sum_``i''_``j''=r(min)
}
}

What command should I use instead of the dots?

Thanks again,
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: [email protected]

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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index