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

Re: st: Re: all possible combinations of three numlists


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: Re: all possible combinations of three numlists
Date   Thu, 14 Oct 2004 13:35:59 -0400

Alternatively, you can use -joinby-:

save the list of i's and j's as

keep i
save ilist

then create the list of k's:

clear
set obs 17
g byte k = _n

joinby ilist
rename i j

joinby ilist

Privet Marilandu, ya k vam podavat'sa na job market budu :)

> > I have 3 numlists i=1-99 j=1-99 and k=1-17. i and j are actually the
> > same but numbers go 1,2,4,7...99 (total of 79 elements). k goes exactly
> > from 1 to 17.
> > I want to construct dataset of three variables i, j, and k that will
> > have all possible combinations ie
> > i   j   k
> > 1  1   1
> > 1  1   2
> > ........
> >
> > 99 99 17
> >
> > Are there any tools to do this?

-- 
Stas Kolenikov
http://stas.kolenikov.name
*
*   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