Thursday, 17 December 2015

Data Management and Visualization Assignment

1) Exploring the statistics involved in weight related health issues. With the below lines of code, I wanted to figure out what is the range of weight for the considered population and whether they are satisfied with their weight or not. Out of all, what is the percentage and frequency of people consuming diet pills and laxatives.


LIBNAME mydata "/courses/d1406ae5ba27fe300" access=readonly;
DATA new; set mydata.addhealth_pds;
LABEL H1GH60="Weight of population"
              H1GH28="Weight satisfaction"
              H1GH29="Willing to change"
              H1GH30D="Diet pills consumption"
              H1GH30E="Laxatives consumption";
PROC SORT; by AID;
PROC FREQ; TABLES h1gh24 h1gh28 h1gh29 h1gh30d h1gh30e;
RUN;

Below is an overview values taken by various variables:

H1GH60:
                range betweenn 50 to 360 pounds
                996: refused
                998: don't know
                999: not applicable

H1GH28:
               1: very underweight
               2: slightly underweight
               3: about the right weight
               4: slightly overweight
               5: very overweight
               6: refused
               8: don't know
H1GH29 takes values like loose weight, gain weigt, stay the same weight etc
H1GH30D and H1GH30E take values likes marked, not marked, refused, legitimate skip etc

2) Frequency distribution table:

The FREQ Procedure

Weight of population
H1GH60FrequencyPercentCumulative
Frequency
Cumulative
Percent
5010.0210.02
5710.0220.03
6220.0340.06
6720.0360.09
7040.06100.15
7110.02110.17
7310.02120.18
7420.03140.22
75140.22280.43
7610.02290.45
7840.06330.51
7920.03350.54
80150.23500.77
8120.03520.80
82130.20651.00
8330.05681.05
8420.03701.08
85240.37941.45
8650.08991.52
8780.121071.65
8870.111141.75
89100.151241.91
90340.521582.43
9170.111652.54
92210.321862.86
93140.222003.08
94150.232153.31
95630.972784.27
96260.403044.67
97220.343265.01
98610.943875.95
99150.234026.18
1001151.775177.95
101210.325388.27
102360.555748.83
103320.496069.32
104130.206199.52
1051452.2376411.75
106240.3778812.12
107360.5582412.67
108390.6086313.27
109140.2287713.48
1102283.51110516.99
111230.35112817.34
112600.92118818.27
113360.55122418.82
114430.66126719.48
1152473.80151423.28
116310.48154523.75
117410.63158624.38
118620.95164825.34
119310.48167925.81
1203425.26202131.07
121200.31204131.38
122280.43206931.81
123410.63211032.44
124320.49214232.93
1252383.66238036.59
126290.45240937.04
127320.49244137.53
128420.65248338.18
129170.26250038.44
1303425.26284243.70
131170.26285943.96
132360.55289544.51
133210.32291644.83
134340.52295045.36
1353084.74325850.09
136360.55329450.65
137330.51332751.15
138390.60336651.75
139160.25338252.00
1403315.09371357.09
14190.14372257.23
142370.57375957.80
143280.43378758.23
144150.23380258.46
1452243.44402661.90
146200.31404662.21
147340.52408062.73
148400.62412063.35
149160.25413663.59
1502964.55443268.14
151110.17444368.31
152300.46447368.77
153180.28449169.05
154160.25450769.30
1551732.66468071.96
156200.31470072.26
157140.22471472.48
158260.40474072.88
159120.18475273.06
1602203.38497276.45
16160.09497876.54
162140.22499276.75
163100.15500276.91
16470.11500977.01
1651402.15514979.17
16630.05515279.21
167140.22516679.43
168260.40519279.83
16960.09519879.92
1701261.94532481.86
17140.06532881.92
172250.38535382.30
17390.14536282.44
17480.12537082.56
1751151.77548584.33
176120.18549784.52
17710.02549884.53
178170.26551584.79
17990.14552484.93
1801201.85564486.78
18130.05564786.82
182120.18565987.01
18370.11566687.12
18470.11567387.22
185901.38576388.61
18660.09576988.70
18770.11577688.81
18830.05577988.85
18980.12578788.98
190731.12586090.10
19110.02586190.11
19290.14587090.25
19350.08587590.33
19440.06587990.39
195430.66592291.05
19640.06592691.11
19760.09593291.21
198130.20594591.41
19920.03594791.44
200721.11601992.54
20110.02602092.56
20210.02602192.57
20340.06602592.64
20440.06602992.70
205170.26604692.96
20620.03604892.99
20710.02604993.00
20850.08605493.08
20920.03605693.11
210470.72610393.83
21230.05610693.88
21310.02610793.90
21420.03610993.93
215220.34613194.27
21620.03613394.30
21720.03613594.33
21820.03613794.36
21920.03613994.39
220410.63618095.02
22230.05618395.06
225200.31620395.37
22840.06620795.43
22910.02620895.45
230130.20622195.65
23110.02622295.66
23230.05622595.71
235110.17623695.88
23610.02623795.89
23720.03623995.93
23810.02624095.94
240140.22625496.16
24110.02625596.17
24230.05625896.22
24310.02625996.23
245100.15626996.39
24710.02627096.40
24820.03627296.43
250250.38629796.82
25210.02629896.83
25510.02629996.85
25610.02630096.86
26080.12630896.99
26560.09631497.08
27060.09632097.17
27610.02632197.19
28060.09632797.28
28520.03632997.31
28710.02633097.32
29050.08633597.40
29110.02633697.42
29510.02633797.43
30040.06634197.49
30520.03634397.52
32010.02634497.54
32310.02634597.56
32410.02634697.57
33610.02634797.59
36010.02634897.60
996320.49638098.09
9981211.86650199.95
99930.056504100.00
Weight satisfaction
H1GH28FrequencyPercentCumulative
Frequency
Cumulative
Percent
11281.971281.97
293514.38106316.34
3338151.98444468.33
4180827.80625296.13
52383.66649099.78
640.06649499.85
8100.156504100.00
Willing to change
H1GH29FrequencyPercentCumulative
Frequency
Cumulative
Percent
1223034.29223034.29
2123518.99346553.27
3222834.26569387.53
480212.33649599.86
640.06649999.92
850.086504100.00
Diet pills consumption
H1GH30DFrequencyPercentCumulative
Frequency
Cumulative
Percent
0441567.88441567.88
1430.66445868.54
640.06446268.60
7203731.32649999.92
850.086504100.00
Laxatives consumption
H1GH30EFrequencyPercentCumulative
Frequency
Cumulative
Percent
0444668.36444668.36
1120.18445868.54
640.06446268.60
7203731.32649999.92
850.086504100.00
SAS Logs:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 LIBNAME mydata "/courses/d1406ae5ba27fe300" access=readonly;
NOTE: Libref MYDATA was successfully assigned as follows:
Engine: V9
Physical Name: /courses/d1406ae5ba27fe300
57 DATA new; set mydata.addhealth_pds;
NOTE: Data file MYDATA.ADDHEALTH_PDS.DATA is in a format that is native to another host, or the file encoding does not match the
session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
58 LABEL H1GH60="Weight of population"
59 H1GH28="Weight satisfaction"
60 H1GH29="Willing to change"
61 H1GH30D="Diet pills consumption"
62 H1GH30E="Laxatives consumption";
NOTE: There were 6504 observations read from the data set MYDATA.ADDHEALTH_PDS.
NOTE: The data set WORK.NEW has 6504 observations and 2829 variables.
NOTE: DATA statement used (Total process time):
real time 7.30 seconds
user cpu time 1.26 seconds
system cpu time 0.15 seconds
memory 5212.53k
OS Memory 35588.00k
Timestamp 12/18/2015 06:33:32 AM
Step Count 18 Switch Count 52
Page Faults 0
Page Reclaims 1413
Page Swaps 0
Voluntary Context Switches 199
Involuntary Context Switches 1
Block Input Operations 8
Block Output Operations 334088
63 PROC SORT; by AID;
NOTE: There were 6504 observations read from the data set WORK.NEW.
NOTE: The data set WORK.NEW has 6504 observations and 2829 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 6.47 seconds
user cpu time 0.03 seconds
system cpu time 0.25 seconds
memory 173958.62k
OS Memory 203904.00k
Timestamp 12/18/2015 06:33:39 AM
Step Count 19 Switch Count 24
Page Faults 0
Page Reclaims 37154
Page Swaps 0
Voluntary Context Switches 87
Involuntary Context Switches 2
Block Input Operations 8
Block Output Operations 334088
64 PROC FREQ; TABLES h1gh60 h1gh28 h1gh29 h1gh30d h1gh30e;
65 RUN;
NOTE: There were 6504 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.29 seconds
user cpu time 0.27 seconds
system cpu time 0.03 seconds
memory 6203.56k
OS Memory 36268.00k
Timestamp 12/18/2015 06:33:39 AM
Step Count 20 Switch Count 28
Page Faults 0
Page Reclaims 698
Page Swaps 0
Voluntary Context Switches 62
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 376
66
67 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
79

No comments:

Post a Comment