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

st: Re: list options


From   Christopher F Baum <[email protected]>
To   [email protected]
Subject   st: Re: list options
Date   Thu, 29 Jul 2004 07:16:43 -0400

On Jul 29, 2004, at 2:33 AM, statalist-digest wrote:

	Is there a way to "permanently" set options for the -list- command?
For example, when working with time series data it would be helpful if
the list command could be set to always display the separator every 4
(quarterly) or 12 (monthly) observations, and to not show the
observation numbers.  I find I regularly forget to add -,sep(#) noobs-
at the end of each list command, and end up typing it twice....  TIA.

                                         -- Mike

Here's a hack to do that, as a wrapper. It will not deal gracefully with annual data, but that is for StataCorp to fix. Warning: daily caffeine intake has not yet commenced. Do not use this routine to control the operation of nuclear power plants, air traffic control facilities, or medical lasers.

#! tslistq 1.0.0 29jul2004 CFBaum
program tslist
syntax varlist [if] [in], [*]
version 8.2
marksample touse
capt tsset
local unit `r(unit)'
if _rc>0 | "`unit'" == "" {
list `varlist' if `touse' ,`options'
exit
}
if "`unit'" == "quarterly" {
local sep 4
}
if "`unit'" == "monthly" {
local sep 12
}
if "`unit'" == "yearly" {
local sep 10
}
if "`unit'" == "halfyearly" {
local sep 2
}
if "`unit'" == "weekly" {
local sep 13
}
if "`unit'" == "daily" {
local sep 5
}
list `varlist' if `touse', sep(`sep') noobs `options'
exit
end

Kit

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