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

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

* For searches and help try:

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