from __future__ import print_function
import statsmodels.api as sm
import pandas as pd
from patsy import dmatrices
df = sm.datasets.get_rdataset("Guerry", "HistData").data
|
dept |
Region |
Department |
Crime_pers |
Crime_prop |
Literacy |
Donations |
Infants |
Suicides |
MainCity |
... |
Crime_parents |
Infanticide |
Donation_clergy |
Lottery |
Desertion |
Instruction |
Prostitutes |
Distance |
Area |
Pop1831 |
0 |
1 |
E |
Ain |
28870 |
15890 |
37 |
5098 |
33120 |
35039 |
2:Med |
... |
71 |
60 |
69 |
41 |
55 |
46 |
13 |
218.372 |
5762 |
346.03 |
1 |
2 |
N |
Aisne |
26226 |
5521 |
51 |
8901 |
14572 |
12831 |
2:Med |
... |
4 |
82 |
36 |
38 |
82 |
24 |
327 |
65.945 |
7369 |
513.00 |
2 |
3 |
C |
Allier |
26747 |
7925 |
13 |
10973 |
17044 |
114121 |
2:Med |
... |
46 |
42 |
76 |
66 |
16 |
85 |
34 |
161.927 |
7340 |
298.26 |
3 |
4 |
E |
Basses-Alpes |
12935 |
7289 |
46 |
2733 |
23018 |
14238 |
1:Sm |
... |
70 |
12 |
37 |
80 |
32 |
29 |
2 |
351.399 |
6925 |
155.90 |
4 |
5 |
E |
Hautes-Alpes |
17488 |
8174 |
69 |
6962 |
23076 |
16171 |
1:Sm |
... |
22 |
23 |
64 |
79 |
35 |
7 |
1 |
320.280 |
5549 |
129.10 |
5 rows × 23 columns
(86, 23)
|
dept |
Crime_pers |
Crime_prop |
Literacy |
Donations |
Infants |
Suicides |
Wealth |
Commerce |
Clergy |
Crime_parents |
Infanticide |
Donation_clergy |
Lottery |
Desertion |
Instruction |
Prostitutes |
Distance |
Area |
Pop1831 |
count |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
mean |
46.883721 |
19754.406977 |
7843.058140 |
39.255814 |
7075.546512 |
19049.906977 |
36522.604651 |
43.500000 |
42.802326 |
43.430233 |
43.500000 |
43.511628 |
43.500000 |
43.500000 |
43.500000 |
43.127907 |
141.872093 |
207.953140 |
6146.988372 |
378.628721 |
std |
30.426157 |
7504.703073 |
3051.352839 |
17.364051 |
5834.595216 |
8820.233546 |
31312.532649 |
24.969982 |
25.028370 |
24.999549 |
24.969982 |
24.948297 |
24.969982 |
24.969982 |
24.969982 |
24.799809 |
520.969318 |
109.320837 |
1398.246620 |
148.777230 |
min |
1.000000 |
2199.000000 |
1368.000000 |
12.000000 |
1246.000000 |
2660.000000 |
3460.000000 |
1.000000 |
1.000000 |
1.000000 |
1.000000 |
1.000000 |
1.000000 |
1.000000 |
1.000000 |
1.000000 |
0.000000 |
0.000000 |
762.000000 |
129.100000 |
25% |
24.250000 |
14156.250000 |
5933.000000 |
25.000000 |
3446.750000 |
14299.750000 |
15463.000000 |
22.250000 |
21.250000 |
22.250000 |
22.250000 |
22.250000 |
22.250000 |
22.250000 |
22.250000 |
23.250000 |
6.000000 |
121.383000 |
5400.750000 |
283.005000 |
50% |
45.500000 |
18748.500000 |
7595.000000 |
38.000000 |
5020.000000 |
17141.500000 |
26743.500000 |
43.500000 |
42.500000 |
43.500000 |
43.500000 |
43.500000 |
43.500000 |
43.500000 |
43.500000 |
41.500000 |
33.000000 |
200.616000 |
6070.500000 |
346.165000 |
75% |
66.750000 |
25937.500000 |
9182.250000 |
51.750000 |
9446.750000 |
22682.250000 |
44057.500000 |
64.750000 |
63.750000 |
64.750000 |
64.750000 |
64.750000 |
64.750000 |
64.750000 |
64.750000 |
64.750000 |
113.750000 |
289.670500 |
6816.500000 |
444.407500 |
max |
200.000000 |
37014.000000 |
20235.000000 |
74.000000 |
37015.000000 |
62486.000000 |
163241.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
86.000000 |
4744.000000 |
539.213000 |
10000.000000 |
989.940000 |