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

st: -egenmore- updated on SSC

From   "Nick Cox" <>
To   <>
Subject   st: -egenmore- updated on SSC
Date   Mon, 21 Jul 2003 20:16:49 +0100

Thanks to Kit Baum, the -egenmore- package 
has been updated on SSC. -egenmore- is a ragbag 
of user-written -egen- functions written by Kit, 
Steven Stillman, Nick Winter and myself. Most 
require Stata 6; some require Stata 7 or Stata 8. 

The addition is a new function, -repeat()-, 
which requires Stata 8. 

-repeat()- is a sibling of official Stata's 
-egen, fill()- and -egen, seq()-, but it can 
do some things they can't do. 

One is produce sequences of string values. 

Suppose you want a variable which runs January ...
December, repeatedly. 

In Stata 8.1, these names are stored in c(Months), 
so you can go 

. egen months = repeat(), values(`c(Months)') 

Another example: one variable is the levels 10 50 100 200, 
again and again.

. egen levels = repeat(), values(10 50 100 200) 

-repeat()- understands numlists: 

. egen y = repeat(), values(1/12)

and you can repeat in blocks: 

. egen quarter = repeat(), values(1/4) b(3) 

*   For searches and help try:

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