Sunday, January 31, 2016

Frequency Tables

Using data from the Gapminder codebook: female employ rate  and urban rate. The data output was generated using SAS Studio.


Hypothesis formulation
Based on research review, it appears that while more women have joined the labor force thanks to urbanization, they have encountered several cultural and social obstacles that have negatively impacted their employment rates. It would be interesting to study the correlation between urbanization and the female employment rate in the Gapminder dataset. Hypothesis: Higher urbanization rates lead to lower female employment rates.


SAS Studio Program:

/***********************************************************************************/
%web_open_table(WORK.newdata);        /** Predefined SAS Studio macro: Opens the specified table **/

/** Import the saved csv file from folder **/
PROC IMPORT DATAFILE="/folders/myfolders/gapminder.csv"
             DBMS=CSV    /** data source identifier **/
             OUT=work.newdata;   /** the output SAS data set **/
             GETNAMES=YES;   /** generates SAS data set names from the first record in the import file **/

/** Prints the observations in the SAS data set specified by DATA **/
PROC PRINT DATA = work.newdata;
RUN;                                       /** Executes previous SAS statements **/

/** Produces one-way to n-way frequency and contingency tables **/ 
PROC FREQ DATA =  work.newdata;
            TABLES     femaleemployrate employrate urbanrate;
            LABEL femaleemployrate="The female employment rate" /**Assigns descriptive labels to variables **/
                           employrate="The total employment rate" 
                           urbanrate="The urbanization rate";
 RUN;


%web_drop_table(WORK.newdata);                            /**  Predefined SAS Studio macro:Drops the specified table **/

/************************************************************************************/





Observations from results: Gapminder prog1.sas

Female employ rate:

  • There are 213 countries in the Gapminder codebook data..
  • 178 of the 213 countries have female employment statistics listed. 35 of the 213 countries do not have the statistics listed.
  • The highest female employment rate listed is 83.3%, from Burundi.
  • The lowest female employment rate listed is 11.3%, from the West Bank and Gaza. 
  • The female employment rate of 42.1% has the highest frequency distribution of 1.9%. This belongs to 4 countries: Bulgaria, Poland, Albania and Maldives.
  • Of the 178 countries with female employment rate statistics, 76 of these countries (42.7%) have an employment rate equal to or greater than 50%.
  • 0.5% frequency distribution of the female employment rate is observed for the majority (74.7%) of the countries with the statistics.
Employ rate:

  • There are 213 countries in the Gapminder codebook data.
  • 178 of the 213 countries have overall employment statistics listed. 35 of the 213 countries do not have the statistics listed.
  • The highest employment rate listed is 83.2%, from both Burundi and Uganda.
  • The lowest employment rate listed is 32%, from the West Bank and Gaza. 
  • The employment rates with the highest frequency distribution of 1.4% is observed among 21 countries. Their employment rates range between 47.3% and 65%. 
  • Of the 178 countries with employment rate statistics, 141 of these countries (79.2%) have an employment rate equal to or greater than 50%.
  • 0.5% frequency distribution of the employment rate is observed for the majority (60.1%) of the countries with the statistics.
Urban rate:
  • There are 213 countries in the Gapminder codebook data.
  • 203 of the 213 countries have urbanization rate statistics listed. 10 of the 213 countries do not have the statistics listed.
  • The highest urban rate listed is 100%, from 6 countries: Hong Kong / China, Singapore, Macao / China, Cayman Islands, Monaco and Bermuda.
  • The lowest urban rate listed is 10.4%, from Burundi.  
  • The urban rate with the highest frequency distribution of 2.8% is observed among the 6 countries with the highest urban rates. 
  • Of the 203 countries with urbanization rate statistics, 115 of these countries (56.7%) have an urban rate equal to or greater than 50%.
  • 0.5% frequency distribution of the urban rate is observed for the majority (93.1%) of the countries with the statistics.

Results: Gapminder prog1.sas

One-way frequencies:

The FREQ Procedure






The female employment rate
femaleemployrateFrequencyPercentCumulative
Frequency
Cumulative
Percent
Frequency Missing = 35
11.30000019110.5610.56
12.39999961910.5621.12
1310.5631.69
16.70000076310.5642.25
17.70000076310.5652.81
18.20000076310.5663.37
1910.5673.93
20.29999923710.5684.49
21.39999961910.5695.06
21.89999961910.56105.62
22.20000076310.56116.18
22.29999923710.56126.74
22.60000038110.56137.30
23.20000076310.56147.87
25.60000038110.56158.43
26.79999923710.56168.99
26.89999961910.56179.55
27.89999961910.561810.11
30.10000038110.561910.67
30.20000076310.562011.24
30.39999961910.562111.80
31.70000076310.562212.36
32.29999923710.562312.92
34.20000076321.122514.04
34.29999923710.562614.61
34.40000152610.562715.17
34.59999847410.562815.73
34.90000152610.562916.29
35.40000152610.563016.85
35.510.563117.42
35.79999923710.563217.98
3610.563318.54
36.29999923710.563419.10
36.510.563519.66
36.79999923710.563620.22
37.29999923721.123821.35
37.79999923710.563921.91
37.90000152610.564022.47
3810.564123.03
38.09999847410.564223.60
38.20000076310.564324.16
38.29999923710.564424.72
38.70000076310.564525.28
38.79999923710.564625.84
39.20000076310.564726.40
39.40000152610.564826.97
39.59999847431.695128.65
39.90000152610.565229.21
40.09999847410.565329.78
40.29999923710.565430.34
40.510.565530.90
41.09999847410.565631.46
41.70000076321.125832.58
41.79999923710.565933.15
4210.566033.71
42.09999847442.256435.96
43.09999847410.566536.52
43.40000152610.566637.08
43.59999847421.126838.20
43.70000076310.566938.76
43.79999923710.567039.33
4410.567139.89
44.09999847410.567240.45
44.79999923710.567341.01
45.29999923721.127542.13
45.510.567642.70
45.59999847410.567743.26
45.79999923710.567843.82
45.90000152621.128044.94
4610.568145.51
46.20000076310.568246.07
46.40000152610.568346.63
46.79999923721.128547.75
47.09999847431.698849.44
47.510.568950.00
47.59999847410.569050.56
4810.569151.12
48.40000152610.569251.69
48.510.569352.25
48.59999847410.569452.81
48.79999923721.129653.93
4910.569754.49
49.40000152621.129955.62
49.70000076310.5610056.18
49.79999923710.5610156.74
49.90000152610.5610257.30
50.09999847410.5610357.87
50.40000152610.5610458.43
50.510.5610558.99
50.59999847410.5610659.55
50.70000076321.1210860.67
50.90000152610.5610961.24
5110.5611061.80
51.29999923731.6911363.48
51.59999847410.5611464.04
51.70000076310.5611564.61
52.09999847410.5611665.17
52.29999923710.5611765.73
52.59999847421.1211966.85
53.09999847410.5612067.42
53.20000076310.5612167.98
53.29999923710.5612268.54
53.40000152610.5612369.10
53.510.5612469.66
53.59999847410.5612570.22
53.79999923710.5612670.79
53.90000152610.5612771.35
54.29999923710.5612871.91
54.59999847421.1213073.03
54.70000076310.5613173.60
54.90000152610.5613274.16
55.510.5613374.72
5621.1213575.84
56.20000076310.5613676.40
56.70000076310.5613776.97
56.90000152610.5613877.53
5710.5613978.09
57.510.5614078.65
58.09999847421.1214279.78
58.20000076321.1214480.90
58.29999923710.5614581.46
58.90000152610.5614682.02
59.29999923710.5614782.58
59.79999923710.5614883.15
60.29999923710.5614983.71
60.70000076310.5615084.27
60.90000152610.5615184.83
61.59999847410.5615285.39
62.90000152610.5615385.96
63.40000152610.5615486.52
64.09999847410.5615587.08
6510.5615687.64
65.30000305210.5615788.20
65.69999694810.5615888.76
66.30000305210.5615989.33
66.510.5616089.89
66.59999847410.5616190.45
67.59999847410.5616291.01
68.90000152621.1216492.13
6910.5616592.70
69.40000152610.5616693.26
69.59999847410.5616793.82
7310.5616894.38
73.40000152610.5616994.94
75.80000305210.5617095.51
76.09999847410.5617196.07
77.59999847410.5617296.63
78.09999847410.5617397.19
79.19999694810.5617497.75
8010.5617598.31
80.510.5617698.88
82.19999694810.5617799.44
83.30000305210.56178100.00
The total employment rate
employrateFrequencyPercentCumulative
Frequency
Cumulative
Percent
Frequency Missing = 35
3210.5610.56
34.90000152610.5621.12
37.40000152610.5631.69
38.90000152610.5642.25
3910.5652.81
40.09999847410.5663.37
41.09999847410.5673.93
41.20000076310.5684.49
41.59999847410.5695.06
4210.56105.62
42.40000152621.12126.74
42.510.56137.30
42.79999923710.56147.87
43.09999847410.56158.43
44.20000076310.56168.99
44.29999923710.56179.55
44.70000076310.561810.11
44.79999923710.561910.67
45.70000076310.562011.24
4621.122212.36
46.20000076310.562312.92
46.40000152610.562413.48
46.79999923710.562514.04
46.90000152610.562614.61
47.09999847410.562715.17
47.29999923731.693016.85
47.79999923710.563117.42
48.59999847421.123318.54
48.70000076321.123519.66
49.510.563620.22
49.59999847410.563720.79
50.510.563821.35
50.70000076310.563921.91
50.90000152621.124123.03
5121.124324.16
51.20000076321.124525.28
51.29999923710.564625.84
51.40000152610.564726.40
52.09999847410.564826.97
52.510.564927.53
52.70000076310.565028.09
53.09999847410.565128.65
53.40000152621.125329.78
53.531.695631.46
54.40000152610.565732.02
54.521.125933.15
54.59999847410.566033.71
55.09999847410.566134.27
55.40000152610.566234.83
55.59999847410.566335.39
55.70000076310.566435.96
55.90000152631.696737.64
5621.126938.76
56.29999923721.127139.89
56.40000152610.567240.45
56.510.567341.01
56.79999923721.127542.13
56.90000152610.567642.70
57.09999847410.567743.26
57.20000076310.567843.82
57.29999923710.567944.38
57.521.128145.51
57.59999847410.568246.07
57.90000152610.568346.63
58.20000076321.128547.75
58.40000152621.128748.88
58.510.568849.44
58.59999847410.568950.00
58.79999923721.129151.12
58.90000152631.699452.81
5921.129653.93
59.09999847421.129855.06
59.29999923710.569955.62
59.70000076310.5610056.18
59.79999923710.5610156.74
59.90000152631.6910458.43
60.40000152621.1210659.55
60.510.5610760.11
60.70000076310.5610860.67
60.90000152610.5610961.24
6121.1211162.36
61.29999923710.5611262.92
61.531.6911564.61
61.70000076310.5611665.17
61.79999923710.5611765.73
62.29999923710.5611866.29
62.40000152610.5611966.85
62.70000076310.5612067.42
63.09999847410.5612167.98
63.20000076310.5612268.54
63.510.5612369.10
63.59999847410.5612469.66
63.70000076310.5612570.22
63.79999923721.1212771.35
63.90000152610.5612871.91
64.19999694810.5612972.47
64.30000305210.5613073.03
64.510.5613173.60
64.59999847410.5613274.16
64.90000152610.5613374.72
6531.6913676.40
65.09999847410.5613776.97
65.59999847410.5613877.53
65.69999694810.5613978.09
65.90000152610.5614078.65
6621.1214279.78
66.19999694810.5614380.34
66.59999847410.5614480.90
66.80000305210.5614581.46
66.90000152610.5614682.02
67.30000305210.5614782.58
6810.5614883.15
68.09999847410.5614983.71
68.30000305210.5615084.27
68.90000152610.5615184.83
70.40000152621.1215385.96
7110.5615486.52
71.30000305210.5615587.08
71.59999847410.5615687.64
71.69999694810.5615788.20
71.80000305210.5615888.76
7210.5615989.33
72.80000305210.5616089.89
73.09999847410.5616190.45
73.19999694810.5616291.01
73.59999847410.5616391.57
74.69999694810.5616492.13
75.19999694810.5616592.70
75.69999694810.5616693.26
7610.5616793.82
7710.5616894.38
78.19999694821.1217095.51
78.90000152610.5617196.07
79.80000305210.5617296.63
80.69999694810.5617397.19
81.30000305210.5617497.75
81.510.5617598.31
8310.5617698.88
83.19999694821.12178100.00
The urbanization rate
urbanrateFrequencyPercentCumulative
Frequency
Cumulative
Percent
Frequency Missing = 10
10.410.4910.49
12.5410.4920.99
12.9810.4931.48
13.2210.4941.97
14.3210.4952.46
15.110.4962.96
16.5410.4973.45
1710.4983.94
17.2410.4994.43
17.9610.49104.93
18.3410.49115.42
18.810.49125.91
19.5610.49136.40
20.7210.49146.90
21.5610.49157.39
21.610.49167.88
22.5410.49178.37
2310.49188.87
24.0410.49199.36
24.7610.49209.85
24.7810.492110.34
24.9410.492210.84
25.4610.492311.33
25.5210.492411.82
26.4610.492512.32
26.6810.492612.81
27.1410.492713.30
27.310.492813.79
27.8420.993014.78
28.0810.493115.27
28.3810.493215.76
29.5210.493316.26
29.5410.493416.75
29.8410.493517.24
30.4610.493617.73
30.6410.493718.23
30.8410.493818.72
30.8810.493919.21
32.1810.494019.70
32.3210.494120.20
32.5810.494220.69
33.3210.494321.18
33.9610.494421.67
34.4410.494522.17
34.4810.494622.66
35.4210.494723.15
36.1610.494823.65
36.2810.494924.14
36.5210.495024.63
36.8210.495125.12
36.8420.995326.11
37.3410.495426.60
37.7610.495527.09
37.8610.495627.59
38.5810.495728.08
39.3810.495828.57
39.8410.495929.06
4110.496029.56
41.210.496130.05
41.4210.496230.54
41.7610.496331.03
4210.496431.53
42.3810.496532.02
42.4810.496632.51
42.7210.496733.00
43.110.496833.50
43.4410.496933.99
43.8410.497034.48
46.7210.497134.98
46.7810.497235.47
46.8410.497335.96
47.0410.497436.45
47.4410.497536.95
47.8810.497637.44
48.3610.497737.93
48.5810.497838.42
48.610.497938.92
48.6210.498039.41
48.7810.498139.90
50.0210.498240.39
51.4610.498340.89
51.6410.498441.38
51.710.498541.87
51.9210.498642.36
52.0410.498742.86
52.3610.498843.35
52.7410.498943.84
53.310.499044.33
54.2210.499144.83
54.2410.499245.32
54.3410.499345.81
56.0210.499446.31
56.4210.499546.80
56.5610.499647.29
56.710.499747.78
56.7410.499848.28
56.7610.499948.77
57.1810.4910049.26
57.2810.4910149.75
57.9410.4910250.25
59.4610.4910350.74
59.5810.4910451.23
59.6210.4910551.72
60.1410.4910652.22
60.1810.4910752.71
60.310.4910853.20
60.5610.4910953.69
60.710.4911054.19
60.7410.4911154.68
6110.4911255.17
61.3210.4911355.67
61.3420.9911556.65
62.6810.4911657.14
63.2610.4911757.64
63.310.4911858.13
63.8610.4911958.62
64.7810.4912059.11
64.9210.4912159.61
65.2210.4912260.10
65.5820.9912461.08
66.4810.4912561.58
66.510.4912662.07
66.610.4912762.56
66.910.4912863.05
66.9610.4912963.55
67.1610.4913064.04
67.510.4913164.53
67.9810.4913265.02
68.0810.4913365.52
68.1210.4913466.01
68.4610.4913566.50
68.6810.4913667.00
69.0210.4913767.49
69.4610.4913867.98
69.910.4913968.47
70.3610.4914068.97
71.0810.4914169.46
71.110.4914269.95
71.410.4914370.44
71.6210.4914470.94
71.910.4914571.43
72.8410.4914671.92
73.210.4914772.41
73.4610.4914872.91
73.4810.4914973.40
73.510.4915073.89
73.6410.4915174.38
73.9210.4915274.88
74.510.4915375.37
74.8210.4915475.86
74.9210.4915576.35
75.6610.4915676.85
77.1210.4915777.34
77.210.4915877.83
77.3610.4915978.33
77.4810.4916078.82
77.5410.4916179.31
77.8810.4916279.80
78.4210.4916380.30
80.410.4916480.79
80.4610.4916581.28
81.4610.4916681.77
81.710.4916782.27
81.8210.4916882.76
82.4210.4916983.25
82.4410.4917083.74
83.5210.4917184.24
83.710.4917284.73
84.5410.4917385.22
85.0410.4917485.71
85.5810.4917586.21
86.5610.4917686.70
86.6810.4917787.19
86.9610.4917887.68
87.310.4917988.18
88.4410.4918088.67
88.5210.4918189.16
88.7410.4918289.66
88.9210.4918390.15
89.9410.4918490.64
91.6610.4918591.13
9210.4918691.63
92.2610.4918792.12
92.310.4918892.61
92.6810.4918993.10
93.1610.4919093.60
93.3210.4919194.09
94.2210.4919294.58
94.2610.4919395.07
95.6410.4919495.57
97.3610.4919596.06
98.3210.4919696.55
98.3610.4919797.04
10062.96203100.00