ó
á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%   RAND Health Insurance Experiment Dataiÿÿÿÿ(   t   utilst   restructuredtexts   This is in the public domain.s9  
The data was collected by the RAND corporation as part of the Health
Insurance Experiment (HIE).

http://www.rand.org/health/projects/hie.html

This data was used in::

    Cameron, A.C. amd Trivedi, P.K. 2005.  `Microeconometrics: Methods
        and Applications,` Cambridge: New York.

And was obtained from: <http://cameron.econ.ucdavis.edu/mmabook/mmadata.html>

See randhie/src for the original data and description.  The data included
here contains only a subset of the original data.  The data varies slightly
compared to that reported in Cameron and Trivedi.
s-   The RAND Co. Health Insurance Experiment Datat    sä  ::

    Number of observations - 20,190
    Number of variables - 10
    Variable name definitions::

        mdvis   - Number of outpatient visits to an MD
        lncoins - ln(coinsurance + 1), 0 <= coninsurance <= 100
        idp     - 1 if individual deductible plan, 0 otherwise
        lpi     - ln(max(1, annual participation incentive payment))
        fmde    - 0 if idp = 1; ln(max(1, MDE/(0.01 coinsurance))) otherwise
        physlm  - 1 if the person has a physical limitation
        disea   - number of chronic diseases
        hlthg   - 1 if self-rated health is good
        hlthf   - 1 if self-rated health is fair
        hlthp   - 1 if self-rated health is poor
        (Omitted category is excellent self-rated health)
c         C   s   t  j t ƒ  d |  ƒS(   s¬  
    Loads the RAND HIE data and returns 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.

    Notes
    -----
    endog - response variable, mdvis
    exog - design
    t	   as_pandas(   t   dut   as_numpy_datasett   load_pandas(   R   (    (    s@   lib/python2.7/site-packages/statsmodels/datasets/randhie/data.pyt   load2   s    c           C   s   t  j t ƒ  d d ƒS(   sð   
    Loads the RAND HIE data and returns a Dataset class.

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

    Notes
    -----
    endog - response variable, mdvis
    exog - design
    t	   endog_idxi    (   R   t   process_pandast	   _get_data(    (    (    s@   lib/python2.7/site-packages/statsmodels/datasets/randhie/data.pyR   I   s    c           C   s   t  j t d ƒ S(   Ns   randhie.csv(   R   t   load_csvt   __file__(    (    (    s@   lib/python2.7/site-packages/statsmodels/datasets/randhie/data.pyR
   Z   s    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/randhie/data.pyt   <module>   s   	