Skip to content

Commit bf28381

Browse files
committed
Load data from file instead of lkibrary
1 parent 0d1cc32 commit bf28381

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

python/binomial_test.qmd

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,16 @@ We will calculate number of deaths and total number of patients.
5353
```{python}
5454
import pandas as pd
5555
56-
# Load the lung dataset as an example (using a mock dataset for demonstration purposes)
57-
from lifelines.datasets import load_lung
58-
lung = load_lung()
56+
# Load the lung cancer dataset from CSV file
57+
lung = pd.read_csv('./data/lung_cancer.csv')
5958
60-
# The 'status' flag in the dataset here is flipped compared to the R version
61-
num_deaths = np.sum(lung['status'] == 0)
59+
# Calculate the number of deaths and total number of patients
60+
num_deaths = np.sum(lung['status'] == 1)
6261
total_pat = lung.shape[0]
6362
6463
num_deaths, total_pat
6564
```
6665

67-
68-
6966
## Conduct the Binomial Test
7067

7168
We will conduct the Binomial test and hypothesize that the proportion of death should be 19%.

0 commit comments

Comments
 (0)