B
    Zk                 @   sl   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mZ d
d Zdd Zdd ZdS )zGrunfeld (1950) Investment DataZrestructuredtextzThis is public domain.a  This is the Grunfeld (1950) Investment Data.

The source for the data was the original 11-firm data set from Grunfeld's Ph.D.
thesis recreated by Kleiber and Zeileis (2008) "The Grunfeld Data at 50".
The data can be found here.
http://statmath.wu-wien.ac.at/~zeileis/grunfeld/

For a note on the many versions of the Grunfeld data circulating see:
http://www.stanford.edu/~clint/bench/grunfeld.htm
z2Grunfeld (1950) Investment Data for 11 U.S. Firms.ax  ::

    Number of observations - 220 (20 years for 11 firms)

    Number of variables - 5

    Variables name definitions::

        invest  - Gross investment in 1947 dollars
        value   - Market value as of Dec. 31 in 1947 dollars
        capital - Stock of plant and equipment in 1947 dollars
        firm    - General Motors, US Steel, General Electric, Chrysler,
                Atlantic Refining, IBM, Union Oil, Westinghouse, Goodyear,
                Diamond Match, American Steel
        year    - 1935 - 1954

    Note that raw_data has firm expanded to dummy variables, since it is a
    string categorical variable.
    )
recfromtxtcolumn_stackarray)utils)dirnameabspathc              C   s:   ddl m}  t }| |ddd}tj|ddd}||_|S )a-  
    Loads the Grunfeld data and returns a Dataset class.

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

    Notes
    -----
    raw_data has the firm variable expanded to dummy variables for each
    firm (ie., there is no reference dummy)
    r   )categoricalfirmT)coldropF)	endog_idxstack)statsmodels.toolsr   	_get_dataduZprocess_recarrayraw_data)r   datar   ds r   Alib/python3.7/site-packages/statsmodels/datasets/grunfeld/data.pyload.   s    r   c              C   sH   ddl m}  ddlm} t }||ddd}tj|dd}| ||_|S )a-  
    Loads the Grunfeld data and returns a Dataset class.

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

    Notes
    -----
    raw_data has the firm variable expanded to dummy variables for each
    firm (ie., there is no reference dummy)
    r   )	DataFrame)r   r	   T)r
   r   )r   )Zpandasr   r   r   r   r   Zprocess_recarray_pandasr   )r   r   r   r   r   r   r   r   load_pandasC   s    
r   c           	   C   s:   t tt} t| d d}t|dddd}W d Q R X |S )Nz/grunfeld.csvrb,Tzf8,f8,f8,a17,f8)Z	delimiternamesZdtype)r   r   __file__openr   )filepathfr   r   r   r   r   Y   s
    r   N)__doc__Z__docformat__Z	COPYRIGHTZTITLEZSOURCEZ
DESCRSHORTZ	DESCRLONGZNOTEZnumpyr   r   r   Zstatsmodels.datasetsr   r   os.pathr   r   r   r   r   r   r   r   r   <module>   s   
