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

st: list options


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: list options
Date   Thu, 29 Jul 2004 16:55:57 -0400

Michael said:

1. I want to see the dates that contain *any* of the variables to be
listed, with missing values indicated as appropriate. A consequence of
using the -marksample touse- command (I think) is that only dates with
*all* the variables to be listed are shown. Put another way, I want to
see the union and not the intersection of the samples corresponding to
the varlist. Simply dropping the -marksample- command caused all -if-
conditions added to -tslist- calls to be ignored, which is no solution.

2. Since I want a list by the time series variable, and since this is
easily recovered from the -tsset- command as `r(timevar)', I made this
the first argument in the list (see below). However, I'd like to be
able to purge the timevar from the varlist if the user (me)
inadvertently included it -- that is, have the timevar listed once
(first) rather than twice. However, I could not figure out how to drop
the timevar from the varlist if it was included.

3. -sep()- puts the dividers in the "wrong" place if the sample
doesn't start with the first sub-unit of time of the year. For
example, -sep(4)- with data starting in the third quarter places the
separator between Q2 and Q3 of subsequent years, rather than at the
change in year (the "natural" place). In theory, I can get around this
problem by using -sepby()- instead of -sep()- as the option on -list-
in my program, if I can identify the year changes. Here is a version
of I have tried:

The latest version of tslist on SSC (1.0.2) deals with #1 and #2. I should have thought of #2. I added a "notimevar" option that allows suppression of the automatic time variable. There is no problem with #1 in the current version.

Dropping timevar from the varlist, btw, is easily done with extended macro function subinstr. For that you need [p] manual. But easier just to include timevar optionally rather than trying to take it out. My version (unlike list itself) requires a varlist.

I realise that #3 is not dealt with nicely. It will take some doing to deal with this gracefully, since e.g. for weekly data you probably want to sep at the quarter end, for daily data on Friday (or Saturday, or Sunday, depending on your orientation), etc. If the data start on a year boundary, it works fine.

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