ó
áp7]c           @   sb   d  Z  d d l m Z d Z d Z e  Z d Z d Z d Z	 d Z
 d d	 „ Z d
 „  Z d „  Z d S(   s   Longley datasetiÿÿÿÿ(   t   utilst   restructuredtexts   This is public domain.s5  
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.
t    s¬   The 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.sW  ::

    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)
c         C   s   t  j t ƒ  d |  ƒS(   s\  
    Load the Longley data and return a Dataset class.

    Parameters
    ----------
    as_pandas : bool
        Flag indicating whether to return pandas DataFrames and Series
        or numpy recarrays and arrays.  If True, returns pandas.

    Returns
    -------
    Dataset instance
        See DATASET_PROPOSAL.txt for more information.
    t	   as_pandas(   t   dut   as_numpy_datasett   load_pandas(   R   (    (    s@   lib/python2.7/site-packages/statsmodels/datasets/longley/data.pyt   load-   s    c          C   s   t  ƒ  }  t j |  d d ƒS(   s    
    Load the Longley data and return a Dataset class.

    Returns
    -------
    Dataset instance
        See DATASET_PROPOSAL.txt for more information.
    t	   endog_idxi    (   t	   _get_dataR   t   process_pandas(   t   data(    (    s@   lib/python2.7/site-packages/statsmodels/datasets/longley/data.pyR   ?   s    		c       	   C   sM   t  j t d ƒ }  |  j d  d  … d d d d d d d g f j t ƒ }  |  S(	   Ns   longley.csvi   i   i   i   i   i   i   (   R   t   load_csvt   __file__t   iloct   astypet   float(   R   (    (    s@   lib/python2.7/site-packages/statsmodels/datasets/longley/data.pyR	   L   s    7N(   t   __doc__t   statsmodels.datasetsR    R   t   __docformat__t	   COPYRIGHTt   TITLEt   SOURCEt
   DESCRSHORTt	   DESCRLONGt   NOTEt   NoneR   R   R	   (    (    (    s@   lib/python2.7/site-packages/statsmodels/datasets/longley/data.pyt   <module>   s   	