Stata 15 help for tsreport

[TS] tsreport -- Report time-series aspects of a dataset or estimation sample

Syntax

tsreport [varlist] [if] [in] [, options]

options Description ------------------------------------------------------------------------- Main detail list periods for each gap casewise treat a period as a gap if any of the specified variables are missing panel do not count panel changes as gaps ------------------------------------------------------------------------- varlist may contain time-series operators; see tsvarlist.

Menu

Statistics > Time series > Setup and utilities > Report time-series aspects of dataset

Description

tsreport reports time gaps in a dataset or in a subset of variables. By default, tsreport reports periods in which no information is recorded in the dataset; the time variable does not include these periods. When you specify varlist, tsreport reports periods in which either no information is recorded in the dataset or the time variable is present, but one or more variables in varlist contain a missing value.

Options

+------+ ----+ Main +-------------------------------------------------------------

detail reports the beginning and ending times of each gap.

casewise specifies that a period for which any of the specified variables are missing be counted as a gap. By default, gaps are reported for each variable individually.

panel specifies that panel changes not be counted as gaps. Whether panel changes are counted as gaps usually depends on how the calling command handles panels.

Examples

--------------------------------------------------------------------------- Setup . webuse tsrptxmpl

Report gaps in time series . tsreport

Report start and end times of each gap in time series . tsreport, detail

Report start and end times of each gap in time series, ignoring panel changes . tsreport, panel detail

--------------------------------------------------------------------------- Setup . webuse hotelprice

Report gaps in time series . tsreport

Report start and end times of each gap where variables are not observed . tsreport price1 price2, detail

Report start and end times of each gap where variables are not observed, using casewise selection . tsreport price1 price2, casewise detail

---------------------------------------------------------------------------

Video example

Formatting and managing dates

Stored results

tsreport, when no varlist is specified or when casewise is specified, stores the following in r():

Scalars r(N_gaps) number of gaps r(N_obs) number of observations r(start) first time in series r(end) last time in series

Macros r(panelvar) name of panel variable r(timevar) name of time variable r(tsfmt) %fmt of time variable

Matrices r(table) matrix containing start and end times of each gap, if detail is specified

tsreport, when a varlist is specified and casewise is not specified, stores the following in r():

Scalars r(N_gaps#) number of gaps for variable # r(N_obs#) number of observations for variable # r(start#) first time in series for variable # r(end#) last time in series for variable #

Macros r(panelvar) name of panel variable r(timevar) name of time variable r(tsfmt) %fmt of time variable r(var#) name of variable #

Matrices r(table#) matrix containing start and end times of each gap for variable #, if detail is specified

When k variables are specified in varlist, # ranges from 1 to k.


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