1. Section 9

Section 9 contains:
Data in the excel sheet 90 days outcome:
1.Re.admission.1,
2.Reason.for.re.admission, 
3.ER.visits.1, 
4.Mortality,
5.AKI, 
6.Bleeding.2, 
7.Blood.transfusion.2,
8.Stroke.3, 
9.MI.3, 
10.Stent.thrombosis.2, 
11.Vascular.complications.2,
12.Re.cath.2, 
13.CABG.3

Purpose of analysis is looking for relationships between 
each risk factors variables in table 1(section 1-4) to outcome of PCI

1.1 Upload library

library(dplyr)
library(survival)
library(survminer)
library(lubridate)
library(gtsummary)
#library(TMB)
library(broom)
library(kableExtra)
library(SemiCompRisks)

1.2 Upload data

d <- read.csv("d:/UPWORK-SAAD/PCI-01.csv")
#---sec4
d1 <- d[,2:19]
d2 <- d[,21:31]
d01 <- cbind(d1,d2)
d3 <- d[,32:40]
d02 <- cbind(d01,d3)
#---sec9
d4 <- d[,74:88]
d05 <- cbind(d02,d4)
d05$Valvular.heart.disease <- as.numeric(d05$Valvular.heart.disease)

2. Model

lm_dat <- 
  d05 %>% 
  filter(Age >= 30) 
lm_dat <- 
  lm_dat %>% 
  mutate(
    lm_T1 = Age - 30
    )
lm_fit <- survfit(Surv(lm_T1, PCI)~
          HTN + Dyslipidemia + 
          HF + Valvular.heart.disease + CKD + Malignancy + 
          Stroke + MI + atrial.fib + COPD + CABG + DM+
          Clopidogrel+ Insulin+Diuretics+
          Normal.BP.1.high.BP..more.than.140.90..2+
          AKI+Bleeding.2+Stroke.3 +
          MI.3+Stent.thrombosis.2+CABG.3,
          data = lm_dat)

coxph(
  Surv(Age, PCI)~
         HTN + Dyslipidemia + 
          HF + Valvular.heart.disease + CKD + Malignancy + 
          Stroke + MI + atrial.fib + COPD + CABG + DM+
          Clopidogrel+ Insulin+Diuretics+
          Normal.BP.1.high.BP..more.than.140.90..2+
          AKI+Bleeding.2+Stroke.3 +
          MI.3+Stent.thrombosis.2+CABG.3, 
  subset = Age >= 30, 
  data = d05
  ) %>% 
  gtsummary::tbl_regression(exp = TRUE)
Characteristic HR1 95% CI1 p-value
HTN 0.66 0.45, 0.95 0.025
Dyslipidemia 1.48 1.10, 1.99 0.009
HF 0.91 0.59, 1.40 0.7
Valvular.heart.disease 0.33 0.18, 0.60 <0.001
CKD 0.66 0.45, 0.98 0.040
Malignancy 0.66 0.37, 1.17 0.2
Stroke 1.10 0.61, 1.98 0.8
MI 1.96 1.44, 2.68 <0.001
atrial.fib 0.41 0.17, 1.02 0.055
COPD 0.55 0.25, 1.20 0.13
CABG 0.93 0.56, 1.54 0.8
DM 0.75 0.53, 1.05 0.10
Clopidogrel 1.33 1.03, 1.73 0.031
Insulin 1.54 1.12, 2.12 0.008
Diuretics 0.80 0.59, 1.08 0.2
Normal.BP.1.high.BP..more.than.140.90..2 0.77 0.59, 1.00 0.049
AKI 1.07 0.86, 1.34 0.5
Bleeding.2 3.38 0.80, 14.3 0.10
Stroke.3 10,231,315 0.00, Inf >0.9
MI.3 0.00 0.00, Inf >0.9
Stent.thrombosis.2
CABG.3 0.00 0.00, Inf >0.9

1 HR = Hazard Ratio, CI = Confidence Interval

3. PLOT Survival Probability

lm_fit1 <- survfit(Surv(lm_T1, PCI) ~ Stroke.3 +
          Stent.thrombosis.2+CABG.3,
              data = lm_dat)       
ggsurvplot(lm_fit1)

3.1 Survival variable PCI vs Stroke

ggsurvplot(
     fit = survfit(Surv(lm_T1, PCI) ~ Stroke.3 , data = lm_dat), times = 60, 
     xlab = "Year", 
     ylab = "Survival probability")

3.2 Survival PCI vs Stent.thrmb

ggsurvplot(
     fit = survfit(Surv(lm_T1, PCI) ~ Stent.thrombosis.2, data = lm_dat), times = 60, 
     xlab = "Year", 
     ylab = "Survival probability")

3.3 Survival variable PCI vs CABG

ggsurvplot(
     fit = survfit(Surv(lm_T1, PCI) ~ CABG.3, data = lm_dat), times = 60, 
     xlab = "Year", 
     ylab = "Survival probability")

4. Analysis

In the table contains information:
1.Variable Dyslipidea Hazard Ratio 1.48 with Confident Interval 95%(1.10, 1.99) PV 0.009 
2.Variable Valvular.heart.disease has Hazard Ratio 0.33, with Confident Interval 95%(0.18, 0.60) and PV 0.001,
3.Variable MI   has Hazard Ratio 1.96   with Confident Interval 95%(1.96    1.44) and PV    <0.001,
4.Variable Clopidogrel Hazard Ratio 1.33    with Confident Interval 95%(1.03, 1.73) and PV 0.031
5.Variable Insulin Hazard Ratio 1.54    with Confident Interval 95%(1.12, 2.12) with PV 0.008

The 5 variable important that statistically satify PValue <- 0.05, show those variables 
have high influence of the PCI

In the probability survival:
1.Variable Stroke.3 with a survival probability of 1 until the age of 40, and continues 
to decrease until over the age of 60
2.Variable CABG.3 with a survival probability of 1 until the age of 60, ande decrease over 60
3.Variable stent.trombosis.2 has a survival probability of 0 continues to decrease 
with increasing age
4.Over hospital treatment 90 days, succes in suppressing the stroke and performing CABG, 
but fail in stent.trombosis.2