B
    Z                 @   sl   d Z dZdZe ZdZdZd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Longley datasetZrestructuredtextzThis is public domain.a5  
The classic 1967 Longley Data

http://www.itl.nist.gov/div898/strd/lls/data/Longley.shtml

::

    Longley, J.W. (1967) "An Appraisal of Least Squares Programs for the
        Electronic Comptuer from the Point of View of the User."  Journal of
        the American Statistical Association.  62.319, 819-41.
 zThe Longley dataset contains various US macroeconomic
variables that are known to be highly collinear.  It has been used to appraise
the accuracy of least squares routines.aW  ::

    Number of Observations - 16

    Number of Variables - 6

    Variable name definitions::

            TOTEMP - Total Employment
            GNPDEFL - GNP deflator
            GNP - GNP
            UNEMP - Number of unemployed
            ARMED - Size of armed forces
            POP - Population
            YEAR - Year (1947 - 1962)
    )
recfromtxtarraycolumn_stack)utils)dirnameabspathc              C   s   t  } tj| dtdS )z
    Load the Longley data and return a Dataset class.

    Returns
    -------
    Dataset instance
        See DATASET_PROPOSAL.txt for more information.
    r   )	endog_idxdtype)	_get_dataduZprocess_recarrayfloat)data r   @lib/python3.7/site-packages/statsmodels/datasets/longley/data.pyload.   s    	r   c              C   s   t  } tj| ddS )z
    Load the Longley data and return a Dataset class.

    Returns
    -------
    Dataset instance
        See DATASET_PROPOSAL.txt for more information.
    r   )r	   )r   r   Zprocess_recarray_pandas)r   r   r   r   load_pandas:   s    	r   c           	   C   s<   t tt} t| d d}t|ddtdd}W d Q R X |S )Nz/longley.csvrb,T)                     )Z	delimiternamesr
   Zusecols)r   r   __file__openr   r   )filepathfr   r   r   r   r   F   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   