help haver dialog: haver
-------------------------------------------------------------------------------
Title
[TS] haver -- Load data from Haver Analytics database
Syntax
Describe contents of a Haver dataset
haver describe filename [, detail]
Describe specified variables in a Haver dataset
haver describe varlist using filename [, detail]
Load Haver dataset
haver use filename [, use_options]
Load specified variables from a Haver dataset
haver use varlist using filename [, use_options]
use_options description
-------------------------------------------------------------------------
tin([constant], [constant]) load data within specified date range
twithin([constant], [constant]) same as tin(), except exclude the end
points of range
tvar(varname) create time variable varname
hmissing(misval) record missing values as misval
fill include observations with missing data
in resulting dataset and record
missing values for them
clear clear data in memory before loading
the Haver dataset
-------------------------------------------------------------------------
Menu
File > Import > Haver Analytics database
Description
Haver Analytics (http://www.haver.com) provides economic and financial
databases in the form of .dat files to which you can purchase access.
The haver command allows you to use those datasets with Stata. The haver
command is provided only with Stata for Windows.
haver describe describes the contents of a Haver file.
haver use loads the specified variables from a Haver file into Stata's
memory.
If filename is specified without a suffix, .dat is assumed.
Option for use with haver describe
detail specifies that a detailed report of all information available on
the variables be presented. By default, the Haver concepts data
type, number of observations, aggregate type, difference type,
magnitude, and date modified are not reported.
Options for use with haver use
tin([constant], [constant]) specifies the date range of the data to be
loaded. constant refers to a date constant specified in the usual
way, e.g., tin(1jan1999, 31dec1999), which would mean from and
including 1 January 1999 through 31 December 1999.
twithin([constant], [constant]) functions the same as tin(), except that
the endpoints of the range will be excluded in the data loaded.
tvar(varname) specifies the name of the time variable Stata will create;
the default is tvar(time). The tvar() variable is the name of the
variable that you would use to tsset the data after loading, although
doing so is unnecessary because haver use automatically tssets the
data for you.
hmissing(misval) specifies which of Stata's 27 missing values (., .a,
..., .z) is to be recorded when there are missing values in the Haver
dataset.
Two kinds of missing values can occur when loading a Haver dataset.
One is created when a variable's data does not span the entire time
series, and these missing values are always recorded as . by Stata.
The other corresponds to an actual missing value recorded in the
Haver format. hmissing() sets what is recorded when this second kind
of missing value is encountered. You could specify hmissing(.h) to
cause Stata's .h code to be recorded here.
The default is to store . for both kinds of missing values. See
missing.
fill specifies that observations with no data be left in the resulting
dataset formed in memory and that missing values be recorded for
them. The default is to exclude such observations, which can result
in the loaded time-series dataset having gaps.
Specifying fill has the same effect as issuing the tsfill command
after loading; see [TS] tsfill.
clear clears the data in memory before loading the Haver dataset.
Examples
Describing data
. haver describe dailytst
. haver describe FDB6 using dailytst, detail
. haver use dailytst.dat
. char list FDB6[]
Merging variables
. haver describe dailytst
. haver use dailytst.dat, clear
. egen fedfunds = rfirst(FFED FFED2 FFED3 FFED4 FFED5 FFED6)
More complex command
. haver use FFED FFED2 using dailytst.dat, tin(1jan1990,31dec1999)
hmissing(.h)
Also see
Manual: [TS] haver
Help: [D] infile, [D] insheet, [D] odbc, [TS] tsset