Question: You are given a csv file (outcomes.csv) that represents the outcomes of patients admitted to ICU. There are 4 columns a. RecordID: record id of
You are given a csv file (outcomes.csv) that represents the outcomes of patients admitted to ICU. There are 4 columns
a. RecordID: record id of a patient.
b. Length of stay (days): number of days between the patient's admission to the ICU and the end of hospitalization. Missing values are indicated as NA.
c. Survival (days): If the patient's death was recorded (in or out of hospital), then Survival is the number of days between ICU admission and death; otherwise, Survival is assigned the value -1.
d. In-hospital death (0: survived during hospital stay, or 1: died-in-hospital)
Write R code to find the following:
A. Number of patients who survived during their stay in hospital.
B. Number of patients who died during their stay in hospital.
C. Average of number of survival days among the patients who died-in-hospital.
D. Among the patients who survived during their stay in hospital, how many of them stayed in the hospital for least 5 days.
E. Among the patients who survived during their stay in hospital, how many of them stayed in the hospital less than 7 days
(Below shows some of the data)
(Below is some of the data)
RecordID Length_of_st Survival In-hospital_death 132539 132540 132541 132543 575 132545 918 132547 1637 132548 132551 132554 132555 132556 132567 132568 132570 132573 740 132575 132577 1438 132582 103 132584 1751 132585 132588 132590 1419 132591 30 132592 3 -1 0 132595 -1 132597 132598 1 132599 132601 132602 121cnc 27 49 no
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
