Statalist The Stata Listserver


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

st: minimum of "all other variables"


From   Steve Vaisey <[email protected]>
To   [email protected]
Subject   st: minimum of "all other variables"
Date   Mon, 16 Oct 2006 23:01:47 -0400

Hello Statalisters,

I have been wrestling with a problem for a while, and I've finally decided to bring it to you for what will probably be an embarassingly quick solution. Here's the problem. Thanks to Nick, I have a program (-myboolean-) that turns fuzzy sets into multiset fuzzy intersections. So, for example, with fuzzy sets A and B, running -myboolean A B- yields four new variables: ab Ab aB AB (where lower = absence [1-set], upper = presence [set], and -- for example -- AB = min(A,B)). Enough background I hope.

What I'd like to do now is to create new variables that contain the maximum value of all OTHER configurations for each configuration produced by -myboolean-. Manually, this is easy to do: otherAB = max(Ab,aB,ab). But with 32 or 64 configuration variables, this is very time consuming. Is there a way to automate this so that:
foreach var of varlist ab - AB {
gen other`var' = max(***all other vars in varlist but `var'***)
}

One final note: in the crisp set case (where set membership is always 0/1) other`var' would always = 1-`var'. But this is not true in the fuzzy case. Hence the difficulty.

Thanks!



================================================
Stephen Vaisey
Caroline H. and Thomas S. Royster, Jr. Fellow
Department of Sociology
University of North Carolina at Chapel Hill
200 Hamilton Hall (CB #3210)
Chapel Hill, NC 27599
WEBSITE: www.unc.edu/~vaisey
DISS. INTRO.: www.unc.edu/~vaisey/diss_intro.pdf
================================================






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