You are on page 1of 16

------------------------------------------------------------------------------------------------

---------------------------------------------
name: <unnamed>
log: C:\Users\JAREDSAM\Documents\1st hospital clinic data analysis.log
log type: text
opened on: 4 Nov 2021, 23:59:54

. import excel "C:\Users\JAREDSAM\Documents\heart_failure_clinical_records_dataset.xlsx",


sheet("heart_failure_clinical_records_") firstrow

. *question 1

. describe anaemia diabetes high_blood_pressure

storage display value


variable name type format label variable label
------------------------------------------------------------------------------------------------
---------------------------------------------
anaemia byte %10.0g anaemia
diabetes byte %10.0g diabetes
high_blood_pr~e byte %10.0g high_blood_pressure

. *question 2

. inspect age creatinine_phosphokinase ejection_fraction platelets serum_creatinine serum_sodium


sex smoking time

age: age Number of Observations


--------- ---------------------------------------
Total Integers Nonintegers
| # Negative - - -
| # # Zero - - -
| # # # Positive 299 297 2
| # # # ----------- ----------- -----------
| # # # Total 299 297 2
| # # # # . Missing -
+---------------------- -----------
40 95 299
(47 unique values)

creatinine_phosphokinase: creatinine_ph Number of Observations


-------------------------------------------------------------------------------
Total Integers Nonintegers
| # Negative - - -
| # Zero - - -
| # Positive 299 299 -
| # ----------- ----------- -----------
| # Total 299 299 -
| # . . . . Missing -
+---------------------- -----------
23 7861 299
(More than 99 unique values)

ejection_fraction: ejection_fraction Number of Observations


------------------------------------- ---------------------------------------
Total Integers Nonintegers
| # Negative - - -
| # Zero - - -
| # Positive 299 299 -
| # ----------- ----------- -----------
| # # Total 299 299 -
| # # # # . Missing -
+---------------------- -----------
14 80 299
(17 unique values)

platelets: platelets Number of Observations


--------------------- ---------------------------------------
Total Integers Nonintegers
| # Negative - - -
| # Zero - - -
| # Positive 299 274 25
| # ----------- ----------- -----------
| # Total 299 274 25
| # # # . . Missing -
+---------------------- -----------
25100 850000 299
(More than 99 unique values)

serum_creatinine: serum_creatinine Number of Observations


----------------------------------- ---------------------------------------
Total Integers Nonintegers
| # Negative - - -
| # Zero - - -
| # Positive 299 56 243
| # ----------- ----------- -----------
| # Total 299 56 243
| # . . . . Missing -
+---------------------- -----------
.5 9.4 299
(40 unique values)

serum_sodium: serum_sodium Number of Observations


--------------------------- ---------------------------------------
Total Integers Nonintegers
| # Negative - - -
| # Zero - - -
| # Positive 299 299 -
| # ----------- ----------- -----------
| # Total 299 299 -
| . . # # # Missing -
+---------------------- -----------
113 148 299
(27 unique values)

sex: sex Number of Observations


--------- ---------------------------------------
Total Integers Nonintegers
| # Negative - - -
| # Zero 105 105 -
| # Positive 194 194 -
| # # ----------- ----------- -----------
| # # Total 299 299 -
| # # Missing -
+---------------------- -----------
0 1 299
(2 unique values)

smoking: smoking Number of Observations


----------------- ---------------------------------------
Total Integers Nonintegers
| # Negative - - -
| # Zero 203 203 -
| # Positive 96 96 -
| # ----------- ----------- -----------
| # # Total 299 299 -
| # # Missing -
+---------------------- -----------
0 1 299
(2 unique values)

time: time Number of Observations


----------- ---------------------------------------
Total Integers Nonintegers
| # Negative - - -
| # Zero - - -
| # # # Positive 299 299 -
| # # # ----------- ----------- -----------
| # # # # # Total 299 299 -
| # # # # # Missing -
+---------------------- -----------
4 285 299
(More than 99 unique values)

. *question 3

. sum age ejection_fraction time

Variable | Obs Mean Std. Dev. Min Max


-------------+---------------------------------------------------------
age | 299 60.83389 11.89481 40 95
ejection_f~n | 299 38.08361 11.83484 14 80
time | 299 130.2609 77.61421 4 285

. *question 4

. sum age anaemia creatinine_phosphokinase diabetes ejection_fraction high_blood_pressure


platelets serum_creatinine serum_sodium sex smoking
> time DEATH_EVENT

Variable | Obs Mean Std. Dev. Min Max


-------------+---------------------------------------------------------
age | 299 60.83389 11.89481 40 95
anaemia | 299 .4314381 .4961073 0 1
creatinine~e | 299 581.8395 970.2879 23 7861
diabetes | 299 .4180602 .4940671 0 1
ejection_f~n | 299 38.08361 11.83484 14 80
-------------+---------------------------------------------------------
high_blood~e | 299 .3511706 .4781364 0 1
platelets | 299 263358 97804.24 25100 850000
serum_crea~e | 299 1.39388 1.03451 .5 9.4
serum_sodium | 299 136.6254 4.412477 113 148
sex | 299 .6488294 .4781364 0 1
-------------+---------------------------------------------------------
smoking | 299 .3210702 .4676704 0 1
time | 299 130.2609 77.61421 4 285
DEATH_EVENT | 299 .3210702 .4676704 0 1

. *question 5

. sum platelets, d

platelets
-------------------------------------------------------------
Percentiles Smallest
1% 51000 25100
5% 130000 47000
10% 153000 51000 Obs 299
25% 212000 62000 Sum of Wgt. 299

50% 262000 Mean 263358


Largest Std. Dev. 97804.24
75% 304000 543000
90% 377000 621000 Variance 9.57e+09
95% 427000 742000 Skewness 1.454975
99% 621000 850000 Kurtosis 9.085906

. *question 6

. tabulate platelets

platelets | Freq. Percent Cum.


------------+-----------------------------------
25100 | 1 0.33 0.33
47000 | 1 0.33 0.67
51000 | 1 0.33 1.00
62000 | 1 0.33 1.34
70000 | 1 0.33 1.67
73000 | 1 0.33 2.01
75000 | 1 0.33 2.34
87000 | 1 0.33 2.68
105000 | 1 0.33 3.01
119000 | 1 0.33 3.34
122000 | 1 0.33 3.68
126000 | 1 0.33 4.01
127000 | 2 0.67 4.68
130000 | 1 0.33 5.02
132000 | 1 0.33 5.35
133000 | 2 0.67 6.02
136000 | 1 0.33 6.35
140000 | 2 0.67 7.02
141000 | 1 0.33 7.36
147000 | 2 0.67 8.03
149000 | 3 1.00 9.03
150000 | 1 0.33 9.36
151000 | 1 0.33 9.70
153000 | 3 1.00 10.70
155000 | 1 0.33 11.04
160000 | 1 0.33 11.37
162000 | 2 0.67 12.04
164000 | 1 0.33 12.37
166000 | 2 0.67 13.04
172000 | 2 0.67 13.71
173000 | 2 0.67 14.38
174000 | 1 0.33 14.72
176000 | 1 0.33 15.05
179000 | 1 0.33 15.38
181000 | 1 0.33 15.72
184000 | 1 0.33 16.05
185000 | 2 0.67 16.72
186000 | 1 0.33 17.06
188000 | 1 0.33 17.39
189000 | 3 1.00 18.39
192000 | 1 0.33 18.73
194000 | 3 1.00 19.73
196000 | 2 0.67 20.40
198000 | 1 0.33 20.74
200000 | 1 0.33 21.07
201000 | 1 0.33 21.40
203000 | 3 1.00 22.41
204000 | 2 0.67 23.08
208000 | 1 0.33 23.41
210000 | 3 1.00 24.41
211000 | 1 0.33 24.75
212000 | 1 0.33 25.08
213000 | 1 0.33 25.42
215000 | 2 0.67 26.09
216000 | 2 0.67 26.76
217000 | 1 0.33 27.09
218000 | 2 0.67 27.76
219000 | 2 0.67 28.43
220000 | 3 1.00 29.43
221000 | 4 1.34 30.77
222000 | 2 0.67 31.44
223000 | 3 1.00 32.44
224000 | 1 0.33 32.78
225000 | 1 0.33 33.11
226000 | 4 1.34 34.45
227000 | 1 0.33 34.78
228000 | 4 1.34 36.12
229000 | 1 0.33 36.45
231000 | 2 0.67 37.12
232000 | 1 0.33 37.46
233000 | 1 0.33 37.79
235000 | 4 1.34 39.13
236000 | 1 0.33 39.46
237000 | 4 1.34 40.80
241000 | 1 0.33 41.14
242000 | 2 0.67 41.81
243000 | 1 0.33 42.14
244000 | 3 1.00 43.14
246000 | 1 0.33 43.48
248000 | 1 0.33 43.81
249000 | 3 1.00 44.82
250000 | 1 0.33 45.15
252000 | 1 0.33 45.48
253000 | 2 0.67 46.15
254000 | 3 1.00 47.16
255000 | 4 1.34 48.49
257000 | 1 0.33 48.83
259000 | 1 0.33 49.16
260000 | 1 0.33 49.50
262000 | 2 0.67 50.17
263000 | 1 0.33 50.50
263358 | 25 8.36 58.86
264000 | 1 0.33 59.20
265000 | 3 1.00 60.20
266000 | 2 0.67 60.87
267000 | 2 0.67 61.54
268000 | 1 0.33 61.87
270000 | 2 0.67 62.54
271000 | 4 1.34 63.88
274000 | 3 1.00 64.88
275000 | 1 0.33 65.22
276000 | 2 0.67 65.89
277000 | 2 0.67 66.56
279000 | 4 1.34 67.89
281000 | 1 0.33 68.23
282000 | 1 0.33 68.56
283000 | 3 1.00 69.57
284000 | 1 0.33 69.90
286000 | 1 0.33 70.23
289000 | 1 0.33 70.57
290000 | 1 0.33 70.90
293000 | 1 0.33 71.24
294000 | 1 0.33 71.57
295000 | 1 0.33 71.91
297000 | 2 0.67 72.58
298000 | 1 0.33 72.91
300000 | 1 0.33 73.24
301000 | 1 0.33 73.58
302000 | 3 1.00 74.58
303000 | 1 0.33 74.92
304000 | 2 0.67 75.59
305000 | 4 1.34 76.92
306000 | 1 0.33 77.26
308000 | 1 0.33 77.59
309000 | 1 0.33 77.93
310000 | 1 0.33 78.26
314000 | 1 0.33 78.60
317000 | 1 0.33 78.93
318000 | 1 0.33 79.26
319000 | 2 0.67 79.93
321000 | 1 0.33 80.27
324000 | 1 0.33 80.60
325000 | 1 0.33 80.94
327000 | 3 1.00 81.94
328000 | 1 0.33 82.27
329000 | 2 0.67 82.94
330000 | 1 0.33 83.28
334000 | 2 0.67 83.95
336000 | 1 0.33 84.28
337000 | 1 0.33 84.62
338000 | 1 0.33 84.95
348000 | 1 0.33 85.28
350000 | 1 0.33 85.62
351000 | 2 0.67 86.29
358000 | 1 0.33 86.62
360000 | 1 0.33 86.96
362000 | 3 1.00 87.96
365000 | 2 0.67 88.63
368000 | 2 0.67 89.30
371000 | 1 0.33 89.63
374000 | 1 0.33 89.97
377000 | 1 0.33 90.30
382000 | 1 0.33 90.64
385000 | 1 0.33 90.97
388000 | 1 0.33 91.30
389000 | 2 0.67 91.97
390000 | 2 0.67 92.64
395000 | 2 0.67 93.31
404000 | 1 0.33 93.65
406000 | 2 0.67 94.31
418000 | 1 0.33 94.65
422000 | 1 0.33 94.98
427000 | 1 0.33 95.32
448000 | 1 0.33 95.65
451000 | 2 0.67 96.32
454000 | 1 0.33 96.66
461000 | 1 0.33 96.99
481000 | 1 0.33 97.32
497000 | 1 0.33 97.66
504000 | 1 0.33 97.99
507000 | 1 0.33 98.33
533000 | 1 0.33 98.66
543000 | 1 0.33 99.00
621000 | 1 0.33 99.33
742000 | 1 0.33 99.67
850000 | 1 0.33 100.00
------------+-----------------------------------
Total | 299 100.00

. *question 7

. gen kenyan universities = platelets/ age


too many variables specified
r(103);

. *question 7

. gen student = platelets/ age

. *question 8

. sum student

Variable | Obs Mean Std. Dev. Min Max


-------------+---------------------------------------------------------
student | 299 4520.065 2050.254 358.5714 18888.89

. *question 9

. sum student, d

student
-------------------------------------------------------------
Percentiles Smallest
1% 728.5714 358.5714
5% 2063.158 573.1707
10% 2471.428 728.5714 Obs 299
25% 3233.333 1033.333 Sum of Wgt. 299

50% 4220 Mean 4520.065


Largest Std. Dev. 2050.254
75% 5380.952 9377.777
90% 6943.396 12066.67 Variance 4203543
95% 7960.784 16488.89 Skewness 2.188005
99% 12066.67 18888.89 Kurtosis 14.06609

. *question 10

. tabulate student

student | Freq. Percent Cum.


------------+-----------------------------------
358.5714 | 1 0.33 0.33
573.1707 | 1 0.33 0.67
728.5714 | 1 0.33 1.00
1033.333 | 1 0.33 1.34
1158.73 | 1 0.33 1.67
1186.441 | 1 0.33 2.01
1500 | 1 0.33 2.34
1521.739 | 1 0.33 2.68
1693.333 | 1 0.33 3.01
1750 | 1 0.33 3.34
1812.5 | 1 0.33 3.68
1862.5 | 2 0.67 4.35
1983.333 | 1 0.33 4.68
2063.158 | 1 0.33 5.02
2103.448 | 1 0.33 5.35
2116.667 | 1 0.33 5.69
2177.215 | 1 0.33 6.02
2188.235 | 1 0.33 6.35
2191.781 | 1 0.33 6.69
2216.667 | 1 0.33 7.02
2266.667 | 1 0.33 7.36
2292.308 | 1 0.33 7.69
2375 | 1 0.33 8.03
2400 | 1 0.33 8.36
2409.836 | 1 0.33 8.70
2439.024 | 1 0.33 9.03
2441.177 | 1 0.33 9.36
2454.545 | 1 0.33 9.70
2471.428 | 1 0.33 10.03
2492.308 | 1 0.33 10.37
2500 | 2 0.67 11.04
2511.111 | 1 0.33 11.37
2514.286 | 1 0.33 11.71
2563.636 | 1 0.33 12.04
2637.931 | 1 0.33 12.37
2642.857 | 2 0.67 13.04
2646.154 | 1 0.33 13.38
2693.877 | 1 0.33 13.71
2764.706 | 1 0.33 14.05
2765.958 | 1 0.33 14.38
2780.822 | 1 0.33 14.72
2796.296 | 1 0.33 15.05
2800 | 1 0.33 15.38
2801.681 | 1 0.33 15.72
2827.586 | 1 0.33 16.05
2841.27 | 1 0.33 16.39
2851.852 | 1 0.33 16.72
2858.823 | 1 0.33 17.06
2892.308 | 1 0.33 17.39
2896.104 | 1 0.33 17.73
2940 | 1 0.33 18.06
2984.615 | 1 0.33 18.39
2986.667 | 1 0.33 18.73
3000 | 1 0.33 19.06
3011.494 | 1 0.33 19.40
3013.699 | 1 0.33 19.73
3022.222 | 1 0.33 20.07
3027.778 | 1 0.33 20.40
3046.154 | 1 0.33 20.74
3058.823 | 1 0.33 21.07
3060 | 2 0.67 21.74
3062.303 | 1 0.33 22.07
3111.111 | 1 0.33 22.41
3123.077 | 1 0.33 22.74
3142.857 | 1 0.33 23.08
3145.455 | 1 0.33 23.41
3175.438 | 1 0.33 23.75
3185.714 | 1 0.33 24.08
3208.955 | 1 0.33 24.41
3233.333 | 2 0.67 25.08
3258.621 | 1 0.33 25.42
3263.889 | 1 0.33 25.75
3266.667 | 1 0.33 26.09
3291.975 | 1 0.33 26.42
3304.348 | 1 0.33 26.76
3306.667 | 1 0.33 27.09
3313.169 | 1 0.33 27.42
3371.428 | 1 0.33 27.76
3385.714 | 1 0.33 28.09
3400 | 1 0.33 28.43
3442.857 | 1 0.33 28.76
3485.714 | 1 0.33 29.10
3500 | 2 0.67 29.77
3507.937 | 1 0.33 30.10
3511.44 | 3 1.00 31.10
3527.778 | 1 0.33 31.44
3533.333 | 3 1.00 32.44
3551.282 | 1 0.33 32.78
3557.143 | 1 0.33 33.11
3564.516 | 1 0.33 33.44
3600 | 2 0.67 34.11
3607.644 | 1 0.33 34.45
3615.385 | 1 0.33 34.78
3616.667 | 1 0.33 35.12
3642.857 | 1 0.33 35.45
3646.154 | 1 0.33 35.79
3666.667 | 1 0.33 36.12
3680 | 1 0.33 36.45
3688.889 | 1 0.33 36.79
3690.909 | 1 0.33 37.12
3745.763 | 1 0.33 37.46
3754.098 | 1 0.33 37.79
3762.258 | 1 0.33 38.13
3773.333 | 1 0.33 38.46
3775.862 | 2 0.67 39.13
3780 | 1 0.33 39.46
3781.25 | 1 0.33 39.80
3800 | 2 0.67 40.47
3805.556 | 2 0.67 41.14
3830.769 | 1 0.33 41.47
3843.75 | 1 0.33 41.81
3855.073 | 1 0.33 42.14
3866.667 | 1 0.33 42.47
3914.634 | 1 0.33 42.81
3930.717 | 1 0.33 43.14
3935.484 | 1 0.33 43.48
3953.846 | 1 0.33 43.81
3984.615 | 1 0.33 44.15
3985.294 | 1 0.33 44.48
4031.746 | 1 0.33 44.82
4051.662 | 3 1.00 45.82
4057.143 | 1 0.33 46.15
4076.923 | 1 0.33 46.49
4080.645 | 1 0.33 46.82
4145.455 | 1 0.33 47.16
4150.943 | 1 0.33 47.49
4153.846 | 1 0.33 47.83
4166.667 | 1 0.33 48.16
4185.714 | 1 0.33 48.49
4192.308 | 1 0.33 48.83
4200 | 2 0.67 49.50
4207.547 | 1 0.33 49.83
4220 | 1 0.33 50.17
4235.294 | 1 0.33 50.50
4238.095 | 1 0.33 50.84
4246.154 | 1 0.33 51.17
4250 | 2 0.67 51.84
4283.019 | 1 0.33 52.17
4320 | 1 0.33 52.51
4323.077 | 1 0.33 52.84
4333.333 | 2 0.67 53.51
4357.143 | 1 0.33 53.85
4362.069 | 1 0.33 54.18
4375 | 1 0.33 54.52
4377.049 | 1 0.33 54.85
4389.3 | 2 0.67 55.52
4461.539 | 1 0.33 55.85
4485.294 | 1 0.33 56.19
4500 | 1 0.33 56.52
4516.667 | 1 0.33 56.86
4523.077 | 1 0.33 57.19
4528.571 | 1 0.33 57.53
4564.516 | 1 0.33 57.86
4569.231 | 1 0.33 58.19
4584.615 | 1 0.33 58.53
4618.182 | 1 0.33 58.86
4622.951 | 1 0.33 59.20
4640 | 1 0.33 59.53
4650 | 1 0.33 59.87
4671.429 | 1 0.33 60.20
4676.923 | 1 0.33 60.54
4682.54 | 1 0.33 60.87
4694.444 | 1 0.33 61.20
4698.113 | 1 0.33 61.54
4716.667 | 1 0.33 61.87
4766.667 | 1 0.33 62.21
4781.818 | 1 0.33 62.54
4788.328 | 3 1.00 63.55
4825.397 | 1 0.33 63.88
4828.125 | 1 0.33 64.21
4850 | 1 0.33 64.55
4852.631 | 1 0.33 64.88
4888.889 | 1 0.33 65.22
4906.667 | 1 0.33 65.55
4909.091 | 1 0.33 65.89
4933.333 | 1 0.33 66.22
4950 | 1 0.33 66.56
4969.02 | 1 0.33 66.89
5014.286 | 2 0.67 67.56
5022.222 | 1 0.33 67.89
5030.769 | 1 0.33 68.23
5040 | 1 0.33 68.56
5071.429 | 1 0.33 68.90
5072.727 | 1 0.33 69.23
5083.333 | 2 0.67 69.90
5114.286 | 1 0.33 70.23
5118.644 | 1 0.33 70.57
5119.048 | 1 0.33 70.90
5163.883 | 1 0.33 71.24
5172.414 | 1 0.33 71.57
5177.778 | 1 0.33 71.91
5200 | 1 0.33 72.24
5240 | 1 0.33 72.58
5267.161 | 1 0.33 72.91
5272.727 | 1 0.33 73.24
5300 | 1 0.33 73.58
5313.726 | 1 0.33 73.91
5320 | 1 0.33 74.25
5326.923 | 1 0.33 74.58
5340.909 | 1 0.33 74.92
5380.952 | 1 0.33 75.25
5466.667 | 1 0.33 75.59
5469.388 | 1 0.33 75.92
5480 | 1 0.33 76.25
5483.333 | 1 0.33 76.59
5511.628 | 1 0.33 76.92
5520 | 1 0.33 77.26
5550 | 1 0.33 77.59
5557.143 | 1 0.33 77.93
5580 | 2 0.67 78.60
5616.667 | 1 0.33 78.93
5637.931 | 1 0.33 79.26
5642.857 | 1 0.33 79.60
5650 | 1 0.33 79.93
5709.091 | 1 0.33 80.27
5725.175 | 1 0.33 80.60
5754.717 | 1 0.33 80.94
5811.321 | 1 0.33 81.27
5852.401 | 2 0.67 81.94
5890.909 | 1 0.33 82.27
5891.304 | 1 0.33 82.61
5964.706 | 1 0.33 82.94
5985.41 | 1 0.33 83.28
6040 | 1 0.33 83.61
6083.333 | 1 0.33 83.95
6109.091 | 1 0.33 84.28
6135.593 | 1 0.33 84.62
6166.667 | 1 0.33 84.95
6200 | 1 0.33 85.28
6226.415 | 1 0.33 85.62
6250 | 1 0.33 85.95
6270.429 | 1 0.33 86.29
6375 | 2 0.67 86.96
6380 | 1 0.33 87.29
6412.053 | 1 0.33 87.63
6423.077 | 1 0.33 87.96
6510.204 | 1 0.33 88.29
6580 | 1 0.33 88.63
6711.111 | 1 0.33 88.96
6745.455 | 1 0.33 89.30
6875 | 1 0.33 89.63
6929.825 | 1 0.33 89.97
6943.396 | 1 0.33 90.30
7111.111 | 1 0.33 90.64
7240 | 2 0.67 91.30
7346.154 | 1 0.33 91.64
7422.222 | 1 0.33 91.97
7516.667 | 1 0.33 92.31
7525 | 1 0.33 92.64
7565.217 | 1 0.33 92.98
7566.667 | 1 0.33 93.31
7575 | 1 0.33 93.65
7614.286 | 1 0.33 93.98
7646.154 | 1 0.33 94.31
7886.792 | 1 0.33 94.65
7900 | 1 0.33 94.98
7960.784 | 1 0.33 95.32
8080 | 1 0.33 95.65
8200 | 1 0.33 95.99
8377.777 | 1 0.33 96.32
8555.556 | 1 0.33 96.66
8625 | 1 0.33 96.99
8666.667 | 1 0.33 97.32
8689.655 | 1 0.33 97.66
8690.477 | 1 0.33 97.99
8714.286 | 1 0.33 98.33
9121.951 | 1 0.33 98.66
9377.777 | 1 0.33 99.00
12066.67 | 1 0.33 99.33
16488.89 | 1 0.33 99.67
18888.89 | 1 0.33 100.00
------------+-----------------------------------
Total | 299 100.00

. *question 11

. count if creatinine_phosphokinase>1000
36

. *qustion 12

. scatter creatinine_phosphokinase platelets

. graph save Graph "C:\Users\JAREDSAM\Documents\Graph.gph"


(file C:\Users\JAREDSAM\Documents\Graph.gph saved)
8000 6000
creatinine_phosphokinase
2000 04000

0 200000 400000 600000 800000


platelets

. *question 13

. sum diabetes if age==60

Variable | Obs Mean Std. Dev. Min Max


-------------+---------------------------------------------------------
diabetes | 33 .5757576 .5018904 0 1

. *question 13

. list DEATH_EVENT if smoking == 1

+----------+
| DEATH_~T |
|----------|
3. | 1 |
6. | 1 |
8. | 1 |
10. | 1 |
11. | 1 |
|----------|
12. | 1 |
23. | 1 |
26. | 1 |
28. | 1 |
30. | 1 |
|----------|
41. | 1 |
42. | 1 |
43. | 1 |
46. | 1 |
48. | 1 |
|----------|
55. | 1 |
57. | 0 |
58. | 0 |
59. | 1 |
60. | 1 |
|----------|
63. | 0 |
66. | 1 |
68. | 1 |
71. | 0 |
72. | 0 |
|----------|
73. | 1 |
74. | 0 |
75. | 1 |
76. | 1 |
77. | 0 |
|----------|
79. | 0 |
82. | 0 |
91. | 0 |
103. | 0 |
104. | 0 |
|----------|
106. | 1 |
109. | 0 |
110. | 0 |
111. | 1 |
112. | 0 |
|----------|
121. | 0 |
129. | 0 |
131. | 0 |
134. | 0 |
135. | 0 |
|----------|
145. | 1 |
146. | 0 |
147. | 0 |
153. | 0 |
154. | 0 |
|----------|
158. | 0 |
160. | 0 |
162. | 0 |
163. | 0 |
167. | 0 |
|----------|
171. | 0 |
172. | 0 |
173. | 0 |
175. | 0 |
176. | 0 |
|----------|
177. | 0 |
180. | 0 |
182. | 1 |
183. | 1 |
185. | 1 |
|----------|
194. | 0 |
200. | 0 |
204. | 0 |
205. | 0 |
211. | 0 |
|----------|
212. | 0 |
213. | 0 |
222. | 0 |
223. | 0 |
227. | 0 |
|----------|
232. | 0 |
234. | 0 |
235. | 0 |
240. | 0 |
242. | 0 |
|----------|
243. | 0 |
249. | 0 |
256. | 0 |
260. | 0 |
266. | 0 |
|----------|
267. | 1 |
271. | 0 |
275. | 0 |
282. | 0 |
283. | 0 |
|----------|
284. | 0 |
293. | 0 |
294. | 0 |
295. | 0 |
298. | 0 |
|----------|
299. | 0 |
+----------+

. *question 14

. sort high_blood_pressure

. list in 1

+-----------------------------------------------------------------------------------------------
-------------------------------+
1. | age | anaemia | creati~e | diabetes | ejecti~n | high_b~e | platel~s | serum_~e |
serum_~m | sex | smoking | time | DEATH_~T |
| 53 | 0 | 196 | 0 | 60 | 0 | 220000 | .7 |
133 | 1 | 1 | 134 | 0 |

|-----------------------------------------------------------------------------------------------
-------------------------------|
| student
|
| 4150.943
|

+-----------------------------------------------------------------------------------------------
-------------------------------+

. sort diabetes

. list in 1

+-----------------------------------------------------------------------------------------------
-------------------------------+
1. | age | anaemia | creati~e | diabetes | ejecti~n | high_b~e | platel~s | serum_~e |
serum_~m | sex | smoking | time | DEATH_~T |
| 78 | 1 | 64 | 0 | 40 | 0 | 277000 | .7 |
137 | 1 | 1 | 187 | 0 |

|-----------------------------------------------------------------------------------------------
-------------------------------|
| student
|
| 3551.282
|

+-----------------------------------------------------------------------------------------------
-------------------------------+
. list diabetes diabetes in 1

+---------------------+
| diabetes diabetes |
|---------------------|
1. | 0 0 |
+---------------------+

. list high_blood_pressure in 1

+----------+
| high_b~e |
|----------|
1. | 0 |
+----------+

. list high_blood_pressure in 1/10

+----------+
| high_b~e |
|----------|
1. | 0 |
2. | 1 |
3. | 0 |
4. | 0 |
5. | 1 |
|----------|
6. | 0 |
7. | 0 |
8. | 0 |
9. | 1 |
10. | 0 |
+----------+

. *question 15

. table sex, c(mean age mean anaemia mean diabetes mean high_blood_pressure mean smoking mean
student)
too many stats()
r(103);

. table sex, c(mean age mean anaemia mean diabetes mean high_blood_pressure)

--------------------------------------------------------------------------
sex | mean(age) mean(anaemia) mean(diabetes) mean(high_b~e)
----------+---------------------------------------------------------------
0 | 59.777781 .4952381 .52380955 .41904762
1 | 61.4055 .39690721 .36082473 .31443298
--------------------------------------------------------------------------

. table sex, c(mean age mean anaemia mean diabetes mean high_blood_pressure mean smoking mean
student)
too many stats()
r(103);

.
. . table sex, c(mean age mean anaemia mean diabetes mean high_blood_pressure mean smoking )

--------------------------------------------------------------------------------
sex | mean(age) mean(anae~a) mean(diab~s) mean(high~e) mean(smok~g)
----------+---------------------------------------------------------------------
0 | 59.777781 .4952381 .52380955 .41904762 .03809524
1 | 61.4055 .39690721 .36082473 .31443298 .4742268
--------------------------------------------------------------------------------

. *qustion 15

. *question 16

. reg age diabetes platelets high_blood_pressure ejection_fraction


Source | SS df MS Number of obs = 299
-------------+---------------------------------- F(4, 294) = 1.86
Model | 1041.18212 4 260.295531 Prob > F = 0.1173
Residual | 41121.7898 294 139.870033 R-squared = 0.0247
-------------+---------------------------------- Adj R-squared = 0.0114
Total | 42162.9719 298 141.486483 Root MSE = 11.827

-------------------------------------------------------------------------------------
age | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------------+----------------------------------------------------------------
diabetes | -2.279216 1.392885 -1.64 0.103 -5.020505 .4620726
platelets | -6.41e-06 7.06e-06 -0.91 0.365 -.0000203 7.49e-06
high_blood_pressure | 2.319104 1.435174 1.62 0.107 -.5054117 5.14362
ejection_fraction | .061474 .0580562 1.06 0.291 -.0527844 .1757324
_cons | 60.31909 2.918071 20.67 0.000 54.57613 66.06205
-------------------------------------------------------------------------------------

. *question 17

. display 9+2
11

. display 3*4
12

. display 16/2
8

. display 5-2
3

. display 5.5 - (0.615*1.86)


4.3561

. display _b[cons] + _b[ ejection_fraction]*1.86


[cons] not found
r(111);

. display 5.5 - (.061*1.86)


5.38654

. display _b[cons] + _b[ejection_fraction]*1.86


[cons] not found
r(111);

. *Nb

. *LEAVE THAT ONE

. *question 18

. predict yhat
(option xb assumed; fitted values)

. predict uhat
(option xb assumed; fitted values)

. predict uhat, residuals


variable uhat already defined
r(110);

. prdict student,participants
command prdict is unrecognized
r(199);

. predict student, participants


variable student already defined
r(110);

. gen mutua = 1 if platelets>226000


(103 missing values generated)
. sum mutua

Variable | Obs Mean Std. Dev. Min Max


-------------+---------------------------------------------------------
mutua | 196 1 0 1 1

. tabulate mutua

mutua | Freq. Percent Cum.


------------+-----------------------------------
1 | 196 100.00 100.00
------------+-----------------------------------
Total | 196 100.00

. log close
name: <unnamed>
log: C:\Users\JAREDSAM\Documents\1st hospital clinic data analysis.log
log type: text
closed on: 5 Nov 2021, 02:08:08
------------------------------------------------------------------------------------------------
---------------------------------------------

You might also like