Tuesday, September 20, 2016

Running my first program


My program is based on the Gapminder data set:

LIBNAME mydata "/courses/d1406ae5ba27fe300 " access=readonly;
DATA new; set mydata.gapminder;
LABEL incomeperperson="Per capita GDP"
    co2emissions="CO2 emissions (in metric tons)"
    urbanrate="Percentage of people in urban areas";
IF incomeperperson LE 16000;
PROC SORT; BY COUNTRY;
PROC FREQ; TABLES co2emissions urbanrate incomeperperson;
RUN;

Since the Gapminder dataset has unique quantitative values for all observations, the frequency distribution tables don't provide any insight to the data. I would therefore like to create subsets within the variables, such as per capita GDP, to group countries as lower, middle and higher income. I was not able to find a way to do this. Therefore I ran a query for countries with per capita GDP of less than and equal to 16,000 USD, which is roughly the baseline for middle and lower income countries.

Results:

CO2 emissions (in metric tons)
co2emissions
Frequency
Percent
Cumulative
Frequency
Cumulative
Percent
132000
1
0.59
1
0.59
850666.66667
1
0.59
2
1.18
1045000
1
0.59
3
1.76
1111000
1
0.59
4
2.35
1206333.3333
1
0.59
5
2.94
1723333.3333
1
0.59
6
3.53
2251333.3333
1
0.59
7
4.12
2335666.6667
1
0.59
8
4.71
2368666.6667
1
0.59
9
5.29
2401666.6667
1
0.59
10
5.88
2907666.6667
1
0.59
11
6.47
2977333.3333
1
0.59
12
7.06
3659333.3333
1
0.59
13
7.65
4352333.3333
1
0.59
14
8.24
4774000
1
0.59
15
8.82
4814333.3333
1
0.59
16
9.41
5210333.3333
1
0.59
17
10.00
5214000
1
0.59
18
10.59
6024333.3333
1
0.59
19
11.18
7315000
1
0.59
20
11.76
7355333.3333
1
0.59
21
12.35
7388333.3333
1
0.59
22
12.94
7601000
1
0.59
23
13.53
7608333.3333
1
0.59
24
14.12
7813666.6667
1
0.59
25
14.71
8092333.3333
1
0.59
26
15.29
8231666.6667
1
0.59
27
15.88
8338000
1
0.59
28
16.47
8968666.6667
1
0.59
29
17.06
9155666.6667
1
0.59
30
17.65
14054333.333
1
0.59
31
18.24
14058000
1
0.59
32
18.82
14241333.333
1
0.59
33
19.41
16225000
1
0.59
34
20.00
16379000
1
0.59
35
20.59
17515666.667
1
0.59
36
21.18
19800000
1
0.59
37
21.76
20152000
1
0.59
38
22.35
20628666.667
1
0.59
39
22.94
21332666.667
1
0.59
40
23.53
21351000
1
0.59
41
24.12
22704000
1
0.59
42
24.71
26125000
1
0.59
43
25.29
26209333.333
1
0.59
44
25.88
28490000
1
0.59
45
26.47
29758666.667
1
0.59
46
27.06
30800000
1
0.59
47
27.65
32233666.667
1
0.59
48
28.24
35717000
1
0.59
49
28.82
35871000
1
0.59
50
29.41
36160666.667
1
0.59
51
30.00
37950000
1
0.59
52
30.59
38991333.333
1
0.59
53
31.18
40857666.667
1
0.59
54
31.76
45411666.667
1
0.59
55
32.35
45778333.333
1
0.59
56
32.94
46306333.333
1
0.59
57
33.53
46684000
1
0.59
58
34.12
49793333.333
1
0.59
59
34.71
51219666.667
1
0.59
60
35.29
52657000
1
0.59
61
35.88
55146666.667
1
0.59
62
36.47
56162333.333
1
0.59
63
37.06
56818666.667
1
0.59
64
37.65
59473333.333
1
0.59
65
38.24
62777000
1
0.59
66
38.82
69329333.333
1
0.59
67
39.41
73784333.333
1
0.59
68
40.00
75944000
1
0.59
69
40.59
78943333.333
1
0.59
70
41.18
81191000
1
0.59
71
41.76
86317000
1
0.59
72
42.35
87970666.667
1
0.59
73
42.94
88337333.333
1
0.59
74
43.53
90269666.667
1
0.59
75
44.12
95256333.333
1
0.59
76
44.71
100782000
1
0.59
77
45.29
102538333.33
1
0.59
78
45.88
104170000
1
0.59
79
46.47
107096000
1
0.59
80
47.06
109681000
1
0.59
81
47.65
119958666.67
1
0.59
82
48.24
125172666.67
1
0.59
83
48.82
125755666.67
1
0.59
84
49.41
127108666.67
1
0.59
85
50.00
131703000
1
0.59
86
50.59
132025666.67
1
0.59
87
51.18
143586666.67
1
0.59
88
51.76
148470666.67
1
0.59
89
52.35
149904333.33
1
0.59
90
52.94
168883000
1
0.59
91
53.53
169180000
1
0.59
92
54.12
170404666.67
1
0.59
93
54.71
170804333.33
1
0.59
94
55.29
183535000
1
0.59
95
55.88
188268666.67
1
0.59
96
56.47
214368000
1
0.59
97
57.06
223747333.33
1
0.59
98
57.65
225019666.67
1
0.59
99
58.24
226255333.33
1
0.59
100
58.82
228748666.67
1
0.59
101
59.41
234864666.67
1
0.59
102
60.00
236419333.33
1
0.59
103
60.59
242594000
1
0.59
104
61.18
248358000
1
0.59
105
61.76
253854333.33
1
0.59
106
62.35
254939666.67
1
0.59
107
62.94
275744333.33
1
0.59
108
63.53
277170666.67
1
0.59
109
64.12
283583666.67
1
0.59
110
64.71
300934333.33
1
0.59
111
65.29
310024000
1
0.59
112
65.88
322960000
1
0.59
113
66.47
340090666.67
1
0.59
114
67.06
377303666.67
1
0.59
115
67.65
428006333.33
1
0.59
116
68.24
446365333.33
1
0.59
117
68.82
487993000
1
0.59
118
69.41
503994333.33
1
0.59
119
70.00
511107666.67
1
0.59
120
70.59
525891666.67
1
0.59
121
71.18
531303666.67
1
0.59
122
71.76
590219666.67
1
0.59
123
72.35
590674333.33
1
0.59
124
72.94
598774000
1
0.59
125
73.53
692039333.33
1
0.59
126
74.12
953051000
1
0.59
127
74.71
999874333.33
1
0.59
128
75.29
1146277000
1
0.59
129
75.88
1286670000
1
0.59
130
76.47
1321661000
1
0.59
131
77.06
1414031666.7
1
0.59
132
77.65
1425435000
1
0.59
133
78.24
1436893333.3
1
0.59
134
78.82
1712755000
1
0.59
135
79.41
1718339333.3
1
0.59
136
80.00
1776016000
1
0.59
137
80.59
1839471333.3
1
0.59
138
81.18
1865922666.7
1
0.59
139
81.76
2008116000
1
0.59
140
82.35
2269806000
1
0.59
141
82.94
2329308666.7
1
0.59
142
83.53
2386820333.3
1
0.59
143
84.12
2421917666.7
1
0.59
144
84.71
2484925666.7
1
0.59
145
85.29
2670950333.3
1
0.59
146
85.88
2712915333.3
1
0.59
147
86.47
2932108666.7
1
0.59
148
87.06
3157700333.3
1
0.59
149
87.65
3341129000
1
0.59
150
88.24
4200940333.3
1
0.59
151
88.82
4244009000
1
0.59
152
89.41
5248815000
1
0.59
153
90.00
5418886000
1
0.59
154
90.59
5584766000
1
0.59
155
91.18
5675629666.7
1
0.59
156
91.76
5872119000
1
0.59
157
92.35
5896388666.7
1
0.59
158
92.94
6710201666.7
1
0.59
159
93.53
7104137333.3
1
0.59
160
94.12
7861553333.3
1
0.59
161
94.71
9183548000
1
0.59
162
95.29
9580226333.3
1
0.59
163
95.88
10822529667
1
0.59
164
96.47
13304503667
1
0.59
165
97.06
14609848000
1
0.59
166
97.65
23053598333
1
0.59
167
98.24
23404568000
1
0.59
168
98.82
30391317000
1
0.59
169
99.41
101386215333
1
0.59
170
100.00
Frequency Missing = 9
 
More tables: 
Urbanisation rate
Per capita GDP

No comments:

Post a Comment