Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/statsmodels/datasets/strikes/data.py : 73%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""U.S. Strike Duration Data"""
2from statsmodels.datasets import utils as du
4__docformat__ = 'restructuredtext'
6COPYRIGHT = """This is public domain."""
7TITLE = __doc__
8SOURCE = """
9This is a subset of the data used in Kennan (1985). It was originally
10published by the Bureau of Labor Statistics.
12::
14 Kennan, J. 1985. "The duration of contract strikes in US manufacturing.
15 `Journal of Econometrics` 28.1, 5-28.
16"""
18DESCRSHORT = """Contains data on the length of strikes in US manufacturing and
19unanticipated industrial production."""
21DESCRLONG = """Contains data on the length of strikes in US manufacturing and
22unanticipated industrial production. The data is a subset of the data originally
23used by Kennan. The data here is data for the months of June only to avoid
24seasonal issues."""
26#suggested notes
27NOTE = """::
29 Number of observations - 62
31 Number of variables - 2
33 Variable name definitions::
35 duration - duration of the strike in days
36 iprod - unanticipated industrial production
37"""
41def load_pandas():
42 """
43 Load the strikes data and return a Dataset class instance.
45 Returns
46 -------
47 Dataset instance:
48 See DATASET_PROPOSAL.txt for more information.
49 """
50 data = _get_data()
51 return du.process_pandas(data, endog_idx=0)
54def load(as_pandas=None):
55 """
56 Load the strikes data and return a Dataset class instance.
58 Parameters
59 ----------
60 as_pandas : bool
61 Flag indicating whether to return pandas DataFrames and Series
62 or numpy recarrays and arrays. If True, returns pandas.
64 Returns
65 -------
66 Dataset instance:
67 See DATASET_PROPOSAL.txt for more information.
68 """
69 return du.as_numpy_dataset(load_pandas(), as_pandas=as_pandas)
72def _get_data():
73 return du.load_csv(__file__,'strikes.csv').astype(float)