Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: creating set-theoretic variables


From   Steve Vaisey <[email protected]>
To   [email protected]
Subject   st: creating set-theoretic variables
Date   Thu, 15 Dec 2005 14:23:33 -0500

Hello all,

I have a question. I am working with a dataset with 4 variables, A, B, C, and D, which vary continously from 0 to 1. These variables represent set theoretic conditions (i.e., they are "fuzzy set" values). What I would like to do is combine them into 16 new variables, each of which represents a Boolean "ideal type." Capital letters represent the presence of the set and lowercase represents the absence of the set. But since we're dealing with fuzzy sets (not Boolean sets), "trueness" = X and "falseness" = (1-X). I hope that's enough background. Anyway, here's what I'm doing manually:

gen ABCD = min(A,B,C,D)
gen ABCd = min(A,B,C,(1-D))
gen ABcd = min(A,B,(1-C),(1-D))
etc.

Is there an easier way to do this so that Stata takes these 4 and makes 16 new variables? Doing it manually isn't so bad when you have 3 or 4 variables, but with 5 or 6 (32 or 64 combinations), it gets tiresome.

Thanks!

Steve

--
====================================================
Stephen B. Vaisey
National Science Foundation Graduate Research Fellow
Caroline H. and Thomas S. Royster, Jr. Fellow
Department of Sociology
University of North Carolina at Chapel Hill
CB #3210, Hamilton Hall
Chapel Hill, NC 27599
====================================================

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