Skip to content

Commit

Permalink
#234 Added code outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladyslav committed Oct 11, 2024
1 parent 87bdf07 commit 35fc952
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ egdtc <- vs %>%
rename(EGDTC = VSDTC)
```

The output:

```
USUBJID VISIT EGDTC
<chr> <chr> <chr>
1 01-701-1015 SCREENING 1 2013-12-26
2 01-701-1015 SCREENING 2 2013-12-31
3 01-701-1015 BASELINE 2014-01-02
4 01-701-1015 AMBUL ECG PLACEMENT 2014-01-14
5 01-701-1015 WEEK 2 2014-01-16
6 01-701-1015 WEEK 4 2014-01-30
```

### 3. Generating a Grid of Patient Data

Here, I create a grid of all possible combinations of subject IDs, test codes (e.g., `QT`, `HR`, `RR`, `ECGINT`), time points (e.g., after lying down, after standing), and visits. These combinations represent different test results collected across multiple visits.
Expand Down Expand Up @@ -114,6 +127,18 @@ eg <- expand.grid(
)
```

The output:

```
USUBJID EGTESTCD EGTPT VISIT
1 01-701-1015 QT AFTER LYING DOWN FOR 5 MINUTES SCREENING 1
2 01-701-1015 HR AFTER LYING DOWN FOR 5 MINUTES SCREENING 1
3 01-701-1015 RR AFTER LYING DOWN FOR 5 MINUTES SCREENING 1
4 01-701-1015 ECGINT AFTER LYING DOWN FOR 5 MINUTES SCREENING 1
5 01-701-1015 QT AFTER STANDING FOR 1 MINUTE SCREENING 1
6 01-701-1015 HR AFTER STANDING FOR 1 MINUTE SCREENING 1
```

### 4. Generating Random Test Results

For each combination in the grid, I generate random test results using a normal distribution to simulate realistic values for each test code. To determine the means and standard deviations, I used the original EG dataset as a reference. By analyzing the range and distribution of values in the original dataset, I could extract realistic means and standard deviations for each ECG test (e.g., QT, HR, RR, ECGINT). This approach allowed me to ensure that the synthetic data aligned closely with the patterns and variability observed in the original clinical data.
Expand Down

0 comments on commit 35fc952

Please sign in to comment.