reconnect moved files to git repo
This commit is contained in:
@ -0,0 +1,5 @@
|
||||
__all__ = ["load", "load_pandas",
|
||||
"COPYRIGHT", "TITLE", "SOURCE", "DESCRSHORT", "DESCRLONG", "NOTE"]
|
||||
from .data import (
|
||||
load, load_pandas,
|
||||
COPYRIGHT, TITLE, SOURCE, DESCRSHORT, DESCRLONG, NOTE)
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,18 @@
|
||||
"STATE","EXECUTIONS","INCOME","PERPOVERTY","PERBLACK","VC100k96","SOUTH","DEGREE"
|
||||
"Texas",37,34453,16.7,12.2,644,1,0.16
|
||||
"Virginia",9,41534,12.5,20,351,1,0.27
|
||||
"Missouri",6,35802,10.6,11.2,591,0,0.21
|
||||
"Arkansas",4,26954,18.4,16.1,524,1,0.16
|
||||
"Alabama",3,31468,14.8,25.9,565,1,0.19
|
||||
"Arizona",2,32552,18.8,3.5,632,0,0.25
|
||||
"Illinois",2,40873,11.6,15.3,886,0,0.25
|
||||
"South_Carolina",2,34861,13.1,30.1,997,1,0.21
|
||||
"Colorado",1,42562,9.4,4.3,405,0,0.31
|
||||
"Florida",1,31900,14.3,15.4,1051,1,0.24
|
||||
"Indiana",1,37421,8.2,8.2,537,0,0.19
|
||||
"Kentucky",1,33305,16.4,7.2,321,0,0.16
|
||||
"Louisiana",1,32108,18.4,32.1,929,1,0.18
|
||||
"Maryland",1,45844,9.3,27.4,931,0,0.29
|
||||
"Nebraska",1,34743,10,4,435,0,0.24
|
||||
"Oklahoma",1,29709,15.2,7.7,597,0,0.21
|
||||
"Oregon",1,36777,11.7,1.8,463,0,0.25
|
||||
|
@ -0,0 +1,75 @@
|
||||
"""US Capital Punishment dataset."""
|
||||
from statsmodels.datasets import utils as du
|
||||
|
||||
__docformat__ = 'restructuredtext'
|
||||
|
||||
COPYRIGHT = """Used with express permission from the original author,
|
||||
who retains all rights."""
|
||||
TITLE = __doc__
|
||||
SOURCE = """
|
||||
Jeff Gill's `Generalized Linear Models: A Unified Approach`
|
||||
|
||||
http://jgill.wustl.edu/research/books.html
|
||||
"""
|
||||
|
||||
DESCRSHORT = """Number of state executions in 1997"""
|
||||
|
||||
DESCRLONG = """This data describes the number of times capital punishment is implemented
|
||||
at the state level for the year 1997. The outcome variable is the number of
|
||||
executions. There were executions in 17 states.
|
||||
Included in the data are explanatory variables for median per capita income
|
||||
in dollars, the percent of the population classified as living in poverty,
|
||||
the percent of Black citizens in the population, the rate of violent
|
||||
crimes per 100,000 residents for 1996, a dummy variable indicating
|
||||
whether the state is in the South, and (an estimate of) the proportion
|
||||
of the population with a college degree of some kind.
|
||||
"""
|
||||
|
||||
NOTE = """::
|
||||
|
||||
Number of Observations - 17
|
||||
Number of Variables - 7
|
||||
Variable name definitions::
|
||||
|
||||
EXECUTIONS - Executions in 1996
|
||||
INCOME - Median per capita income in 1996 dollars
|
||||
PERPOVERTY - Percent of the population classified as living in poverty
|
||||
PERBLACK - Percent of black citizens in the population
|
||||
VC100k96 - Rate of violent crimes per 100,00 residents for 1996
|
||||
SOUTH - SOUTH == 1 indicates a state in the South
|
||||
DEGREE - An esimate of the proportion of the state population with a
|
||||
college degree of some kind
|
||||
|
||||
State names are included in the data file, though not returned by load.
|
||||
"""
|
||||
|
||||
|
||||
def load_pandas():
|
||||
"""
|
||||
Load the cpunish data and return a Dataset class.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Dataset
|
||||
See DATASET_PROPOSAL.txt for more information.
|
||||
"""
|
||||
data = _get_data()
|
||||
return du.process_pandas(data, endog_idx=0)
|
||||
|
||||
|
||||
def load():
|
||||
"""
|
||||
Load the cpunish data and return a Dataset class.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Dataset
|
||||
See DATASET_PROPOSAL.txt for more information.
|
||||
"""
|
||||
return load_pandas()
|
||||
|
||||
|
||||
def _get_data():
|
||||
data = du.load_csv(__file__, 'cpunish.csv')
|
||||
data = data.iloc[:, 1:8].astype(float)
|
||||
return data
|
||||
Reference in New Issue
Block a user