File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,19 +53,16 @@ We will calculate number of deaths and total number of patients.
5353``` {python}
5454import 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 )
6261total_pat = lung.shape[0]
6362
6463num_deaths, total_pat
6564```
6665
67-
68-
6966## Conduct the Binomial Test
7067
7168We will conduct the Binomial test and hypothesize that the proportion of death should be 19%.
You can’t perform that action at this time.
0 commit comments