MSDS 490: Healthcare Analytics and Decision Making Project 3R

Java Python MSDS 490: Healthcare Analytics and Decision Making

Project 3

Due Date: 11/18/2024 (Monday Midnight)

Submission Instructions: zip all your files (R code, data, Word document, figures, etc.) into one, following the file naming convention Last Name First Name Project#.zip Use online submission tools in Canvas to submit this project.

Total Score:  100.

Liver cirrhosis is a late stage of scarring (fibrosis) of the liver caused by many forms of liver diseases, such as hepatitis, chronic alcoholism, and metabolic disease.  It is a severe condition that can lead to liver failure, and it is associated with significant morbidity and mortality.  The progression of liver cirrhosis is often staged, and various clinical factors can influence patient survival.  This project utilizes a dataset of cirrhosis patient to estimate their survival using survival analysis.

Dataset Information.  The dataset includes clinical and demographic variables, along with survival out- comes.  It provides information on patient age, gender, clinical conditions (Patient Disease Stage, Frailty), lab results (Albumin, Triglycerides, Platelets, Total Cholestrol), and derived scores (MELD). The data also has information on the day at which MELD score became available.  Two types are outcomes are possible for a patient prior to the study end time or patient getting lost to the study:  (1) patient receiving a liver trans- plant; (2) death (indicated by ‘D’). The number of days between liver cirrhosis and these events (N Days) and the type of event (Status) is also provided in the table in the ‘Status’ column:  ‘C’ indicates censored, ’D’ indicates death, and ’CL’ indicates liver transplant.

Variable Name

Type

Description

Missing Value

ID

Integer

Unique identifier

No

N Days

Integer

number of days between diagnosis and the

earlier of death, transplantation, or study analysis time

No

Status

Categorical

status of the patient C (censored),

CL (censored due to liver tx), or D (death)

No

Age

Intger

age (days)

No

Gender

Categorical

Male (M) or Female (F)

No

Albumin

Continuous

albumin

MSDS 490: Healthcare Analytics and Decision Making Project 3R

No

Triglycerides

Continuous

triglycerides

Yes

Platelets

Integer

platelets per cubic (ml/1000)

Yes

Stage

Categorical

initial stage of the disease

No

Cholesterol

Integer

serum cholesterol (mg/dl)

Yes

Frailty

Categorical

low (L), intermediate (I), and severe (S)

No

MELD TimeStamp

String

days at which the MELD score is available

No

MELD

Integer

MELD score

No

Note:    Treat ’CL’ as a ’C’ for parts 1-7.  Consider the columns MELD and MELD TimeStamp only for Part 9.

1.  Use the Multivariate Imputation by Chained Equations  (MICE) method to impute missing values in the dataset,  setting the number of multiple imputations to  10 for  10  cycles.   After  completing the imputations, pool the imputed datasets and analyze the results.  Your analysis should include a comparison of the distributions (mean,median, etc) of features before and after imputation.

2.  Plot Kaplan-Meier survival curves stratified by different stages of liver cirrhosis.  How does the survival probability differ across the stages of cirrhosis?

3. Ignore MELD score covariate, and associated date information.   Calculate the hazard ratios for all attributes in the dataset using Cox proportional hazards regression. Which features significantly affect survival?

4.  Check the proportional hazards assumption and also the linearity assumption of continuous covariates (Albumin, SGOT) in the Cox model.

5.  Assume that the frailty variable does not meet the proportional hazards assumption.   Stratify the analysis by frailty.   How  do the hazard ratios change when stratifying by frailty,  and what is the impact on the model?

6.  Adjust the model to include interaction terms between frailty and gender. With the interaction terms included, interpret the hazard ratio of frailty patient with frailty status ‘L’ with those with status ‘I’ and ’S’ .

7.  Plot the adjusted survival curves stratified by different stages.  How do these curves differ from the Kaplan-Meier curves?

8.  Assuming CL as a competing event, perform. a competing risks analysis.  What are the subdistribution hazard ratios for death and transplant?  How do the results of the competing risks analysis compare to the traditional Cox regression model? Plot the cumulative incidence graph.

9.  Consider the MELD score as a time-varying covariate.  Rerun the Cox regression analysis including this covariate         

### 如何在 Windows 系统中安装 PythonQt Designer 并配置环境 #### 安装 PyQt6 和 Qt Designer 为了在 Windows 上使用 Qt Designer,可以通过 `pip` 命令安装最新的 PyQt6 模块。PyQt6 是一个用于创建图形用户界面 (GUI) 应用程序的工具包,并附带了 Qt Designer 工具。 运行以下命令可以完成 PyQt6 及其相关组件的安装: ```bash pip install pyqt6-tools ``` 此命令会自动下载并安装必要的依赖项,其中包括 Qt Designer[^1]。 #### 配置路径以便访问 Qt Designer 安装完成后,通常可以在以下目录找到 Qt Designer 文件(具体位置取决于 Python 解释器的位置): - **对于标准安装**:`C:\Users\<用户名>\AppData\Local\Programs\Python\<版本号>\Lib\site-packages\pyqt6_tools` - 或者通过脚本启动:`python -m pyqt6_designer`. 如果希望直接从文件资源管理器或桌面快捷方式打开 Qt Designer,则需将其可执行文件所在路径添加到系统的环境变量 PATH 中。操作方法如下: 1. 打开控制面板 -> 系统和安全 -> 系统 -> 高级系统设置。 2. 单击“环境变量”,在“系统变量”部分找到名为 “Path”的条目并编辑它。 3. 添加上述提到的设计工具所在的完整路径至列表末尾。 这样处理之后,在任意 CMD 终端窗口输入 designer.exe 就能调用该应用程序。 #### 测试安装成功与否 验证是否正确设置了所有内容的一个简单办法就是尝试加载设计模式本身或者利用 PyQT 创建一个小项目来看看能否正常渲染 UI 元素。下面给出一段简单的例子展示如何载入由设计师保存下来的 .ui 文件并通过 python 运行起来: ```python from PyQt6 import uic import sys from PyQt6.QtWidgets import QApplication, QMainWindow class MyUI(QMainWindow): def __init__(self): super(MyUI,self).__init__() # 加载 ui 文件 uic.loadUi('your_ui_file.ui', self) if __name__ == '__main__': app = QApplication(sys.argv) window = MyUI() window.show() try: sys.exit(app.exec()) except SystemExit: pass ``` 以上代码片段假设存在一个叫做 'your_ui_file.ui' 的文件位于当前工作目录下,它是之前通过 Qt Designer 构建出来的界面布局定义文档。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值