B
    ZH                 @   s   d Z dZdZe ZdZdZeZdZddlm	Z	m
Z
mZ ddlmZ dd	lmZ dd
lmZmZ dd Zdd Zdd ZdddgZdd ZdS )z United States Macroeconomic dataZrestructuredtextzThis is public domain.a  
Compiled by Skipper Seabold. All data are from the Federal Reserve Bank of St.
Louis [1] except the unemployment rate which was taken from the National
Bureau of Labor Statistics [2]. ::

    [1] Data Source: FRED, Federal Reserve Economic Data, Federal Reserve Bank of
        St. Louis; http://research.stlouisfed.org/fred2/; accessed December 15,
        2009.

    [2] Data Source: Bureau of Labor Statistics, U.S. Department of Labor;
        http://www.bls.gov/data/; accessed December 15, 2009.
z)US Macroeconomic Data for 1959Q1 - 2009Q3a   ::
    Number of Observations - 203

    Number of Variables - 14

    Variable name definitions::

        year      - 1959q1 - 2009q3
        quarter   - 1-4
        realgdp   - Real gross domestic product (Bil. of chained 2005 US$,
                    seasonally adjusted annual rate)
        realcons  - Real personal consumption expenditures (Bil. of chained
                    2005 US$, seasonally adjusted annual rate)
        realinv   - Real gross private domestic investment (Bil. of chained
                    2005 US$, seasonally adjusted annual rate)
        realgovt  - Real federal consumption expenditures & gross investment
                    (Bil. of chained 2005 US$, seasonally adjusted annual rate)
        realdpi   - Real private disposable income (Bil. of chained 2005
                    US$, seasonally adjusted annual rate)
        cpi       - End of the quarter consumer price index for all urban
                    consumers: all items (1982-84 = 100, seasonally adjusted).
        m1        - End of the quarter M1 nominal money stock (Seasonally
                    adjusted)
        tbilrate  - Quarterly monthly average of the monthly 3-month
                    treasury bill: secondary market rate
        unemp     - Seasonally adjusted unemployment rate (%)
        pop       - End of the quarter total population: all ages incl. armed
                    forces over seas
        infl      - Inflation rate (ln(cpi_{t}/cpi_{t-1}) * 400)
        realint   - Real interest rate (tbilrate - infl)
    )
recfromtxtcolumn_stackarray)	DataFrame)Dataset)dirnameabspathc              C   s   t  } | jj}t| |d}|S )a  
    Load the US macro data and return a Dataset class.

    Returns
    -------
    Dataset instance:
        See DATASET_PROPOSAL.txt for more information.

    Notes
    -----
    The macrodata Dataset instance does not contain endog and exog attributes.
    )datanames)	_get_datadtyper
   r   )r	   r
   dataset r   Blib/python3.7/site-packages/statsmodels/datasets/macrodata/data.pyload>   s    r   c              C   s   t  } t| j| _| S )N)r   r   r	   )r   r   r   r   load_pandasP   s    r   c           	   C   s:   t tt} t| d d}t|ddtd}W d Q R X |S )Nz/macrodata.csvrb,T)Z	delimiterr
   r   )r   r   __file__openr   float)filepathfr	   r   r   r   r   U   s
    r   ZrealconsZrealgdpZrealinvc               C   s   dS )NZ	macrodatar   r   r   r   r   __str___   s    r   N)__doc__Z__docformat__Z	COPYRIGHTZTITLEZSOURCEZ
DESCRSHORTZ	DESCRLONGZNOTEZnumpyr   r   r   Zpandasr   Zstatsmodels.datasets.utilsr   os.pathr   r   r   r   r   Zvariable_namesr   r   r   r   r   <module>   s     
