Intermediary analysis of R language survival data (2)--manually deriving cox regression intermediary analysis

Mediator is an important statistical concept. If the independent variable X has a certain influence on the dependent variable Y through a certain variable M, then M is called the intermediary variable between X and Y. At present, most of the domestic and foreign studies refer to the causal stepwise regression test. The causal step method was proposed by Baron and Kenny (1986), and its test steps are divided into three steps. First, the regression of X on Y, test the significance of the regression coefficient c); second, the regression of X on M, test the significance of the regression coefficient a); third, the regression of X and M on Y, test Significance of regression coefficients b and c'). If the coefficients c, a, and b are all significant, it means that there is a mediating effect. At this time, if the coefficient c' is not significant, the mediation effect is called a full mediation effect; if the regression coefficient c' is significant, but c' < c, the mediation effect is called a partial mediation effect (partial mediation) ). The effect size of the mediating effect is often measured by ab/c or ab/c'.
insert image description here
In the previous article "R Language Survival Data Cox Regression for Intermediary Analysis (1)", we have introduced the survival data cox regression for intermediary analysis. Recently, some fans wanted me to recommend a BMC article on cox regression of survival data (see references), and asked me to reproduce the method of this article, but I can only do that the intermediary variable is categorical data, and the intermediary variable is continuous data. Still can't do it.
Let's demonstrate today, manually deriving survival data cox regression for mediation analysis. Because this paper does not provide data, I used the survival data of a patient with myocardial infarction. Let's import the data and the R package first

library(survival)
bc<-read.csv("E:/r/test/xgscsj.csv",sep=',',header=TRUE)

insert image description here
Let me introduce this data. This is the survival data of a patient with myocardial infarction. ID is the number of the patient, wmi is the myocardial output of the patient, less than 1L means 0, greater than 1L means 1, and status is the survival outcome indicator. chf is the presence of heart failure, age is 0 if the age is less than 60 years old, and 1 is if the age is greater than 60 years old, sex is the gender, diabetes is the presence or absence of diabetes, time is the survival time, and vf is the presence or absence of ventricular fibrillation.

This article is a reprinted article, the original address is as follows: https://mp.weixin.qq.com/s?__biz=MzI1NjM3NTE1NQ==&mid=2247488895&idx=1&sn=3dea35022c41adfdc32838557f81c022&chksm=ea26f563dd517c75dcc729b 29a1deef0848ba0e39e103f805c18c52d6bdadc53ac4f651c9b8b#rd

Guess you like

Origin blog.csdn.net/dege857/article/details/132268383