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

st: Using egen or similar

Subject   st: Using egen or similar
Date   Fri, 22 Aug 2003 20:43:27 +0200

Dear Stata-listers,

I have six binary variables (m1,..,m6) coded 0/1

I wish to see the frequency of the pattern of  occurring 1s, but preserving
the variable sequence.  I am not sure whether any of "egen" functions can
perform the task  (and I prefer not to use egen..=group(..)).

I started off with the following:

for X in num 2/6: recode mX 1=X

then if there is one of egen functions it would be

egen new=fun(m1 m2 m3 m4 m5 m6)

then tabulate new would yield

	new		freq
	------		------
	1,2,3		63
	1,3,4,5		23
	1,4,5		30
	2,5,6		20

It is if I am "xtdes" but with variables rather than panel time-entries.

Many thanks for your help in advance.  


*   For searches and help try:

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