当前位置:网站首页>R语言 生存分析
R语言 生存分析
2022-06-26 01:31:00 【Mrrunsen】
生存分析涉及预测特定事件将发生的时间。它也被称为失效时间分析或死亡时间分析。例如,预测癌症患者的生存天数或预测机械系统失效的时间。
名为survival的R包用于进行生存分析。这个包包含函数Surv(),它将输入数据作为 R 公式,并在所选变量中创建一个生存对象以进行分析。然后我们使用函数survfit()来创建分析图。
安装包
install.packages("survival")
法
在 R 中创建生存分析的基本语法是 -
Surv(time,event)
survfit(formula)
以下是所用参数的描述 -
time是事件发生之前的后续时间。
event指示预期事件的发生状态。
公式是预测变量之间的关系。
例子
我们将考虑上面安装的生存包中存在的名为“pbc”的数据集。它描述了原发性胆汁性肝硬化 (PBC) 患者的生存数据点。在数据集中存在的许多列中,我们主要关注“时间”和“状态”字段。时间表示患者登记与患者接受肝移植或患者死亡之间的事件早期之间的天数。
边栏推荐
- What is the sudden power failure of iPhone and how to solve it?
- 官方零基础入门 Jetpack Compose 的中文课程来啦!
- Here comes the official zero foundation introduction jetpack compose Chinese course!
- Gold three silver four~
- Wechat launched a web version transmission assistant. Is it really easy to use?
- Small ball bouncing against the wall
- Redis Lua沙盒绕过命令执行(CVE-2022-0543)
- Magnifier case
- 哪个证券公司手机股票开户更好更安全?
- ROS2+DDS+RTPS
猜你喜欢

Raspberry pie + AWS IOT introductory experiment
![[defect detection] automatic defect detection of printed circuit board based on Matlab GUI [including Matlab source code 1912]](/img/c4/75f4209c1fa02a192f79de92dc9ecb.png)
[defect detection] automatic defect detection of printed circuit board based on Matlab GUI [including Matlab source code 1912]

Eureka registration information configuration memo

Introduction to bloc: detailed explanation of cube

College Students' big factory road

【缺陷检测】基于matlab GUI印刷电路板自动缺陷检测【含Matlab源码 1912期】

Deep understanding of distributed cache design

Redis6.0新特性——ACL(权限控制列表)实现限制用户可执行命令和KEY

Depth first traversal based on adjacency table

基于邻接表的深度优先遍历
随机推荐
饼图变形记,肝了3000字,收藏就是学会!
【系统架构】-如何评估软件架构
云答题不显示第三方登陆按钮是什么情况
How to open a stock account? Is it safe to open an account online?
Data analysis - data source, field type, data collection trap
Chapter I: essential information collection of penetration test
OpenAPI 3.0 规范-食用指南
Which securities company should I choose to open an account online? Is it safe to open an account online?
. Net7 miniapi (special part):preview5 optimizes JWT verification (Part 2)
IPhone 13 screen stuck black, unable to shut down? How to solve
网上股票开户安全吗?
Prometeus 2.33.0 new features
Blazor University (33)表单 —— EditContext、FieldIdentifiers
College Students' big factory road
2022-06-25: given a positive number n, it means that there are tasks 0~n-1. Given an array of length N, time[i] means the time when task I is completed. Given a two-dimensional array matrix, matrix[j]
Unexpected output super efficiency SBM model matlab code
Redis classic 20 questions
[image filtering] image filtering system based on Matlab GUI [including Matlab source code 1913]
How do I fix the iPhone green screen problem? Try these solutions
多测师拱墅肖sir_工作目录下的use websocket报错解决方案