Survival Analysis in Industry Applications

INDUSTRY 1 – HEALTHCARE

Time to Relapse After Cancer Treatment

Business Objective

Compare two treatments and determine which one delays relapse longer.

Step 1 - Input Dataset

library(survival)
library(survminer)
## Loading required package: ggplot2
## Loading required package: ggpubr
## 
## Attaching package: 'survminer'
## The following object is masked from 'package:survival':
## 
##     myeloma
healthcare <- data.frame(
id = paste0("P",1:20),
treatment = c(rep("A",10), rep("B",10)),
time = c(6,10,4,8,12,7,9,5,11,3,
8,12,6,14,9,13,7,15,10,16),
event = c(1,0,1,1,0,1,0,1,0,1,
1,0,1,0,1,0,1,0,1,0),
age = c(45,50,39,60,47,55,52,41,48,44,
46,51,38,62,49,53,57,45,43,54),
gender = c("F","M","F","M","F","M","F","M","F","M",
"F","M","F","M","F","M","F","M","F","M")
)

Step 2 - Create Survival Object

Surv_health <- Surv(healthcare$time, healthcare$event)

Step 3 - Kaplan-Meier Curve

km_health <- survfit(Surv_health ~ treatment, data = healthcare)
ggsurvplot(km_health,
data = healthcare,
pval = TRUE,
risk.table = TRUE)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## ℹ The deprecated feature was likely used in the ggpubr package.
##   Please report the issue at <https://github.com/kassambara/ggpubr/issues>.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Ignoring unknown labels:
## • colour : "Strata"

Student Tasks 1

1. Which treatment shows a higher survival probability?

Treatment B has a higher survival probability throughout the observation period (the blue curve is always above the red curve).

2. What is the probability of being relapse-free at month 8?

  • Treatment A: 0.40 (40%)
  • Treatment B: 0.70 (70%)

Read directly from the Kaplan-Meier curve at month 8. Treatment A drops to ~40% due to earlier relapses (red curve falls faster), while Treatment B stays at ~70% (blue curve more stable). The risk table shows: at month 8, only ~4 patients left at risk for A, vs ~7 for B. Visually, B delays relapse better.

3. Does the curve suggest a meaningful difference?

No, the difference between the two treatments is not statistically significant (p-value = 0.35 from the log-rank test > 0.05). This means there is still no strong evidence that one treatment is truly better at delaying relapse. Treatment B looks better on the plot, but the difference is not statistically significant (it could still be due to chance).

Step 4 – Log-Rank Test

survdiff(Surv_health ~ treatment, data = healthcare)
## Call:
## survdiff(formula = Surv_health ~ treatment, data = healthcare)
## 
##              N Observed Expected (O-E)^2/E (O-E)^2/V
## treatment=A 10        6     4.51     0.494     0.879
## treatment=B 10        5     6.49     0.343     0.879
## 
##  Chisq= 0.9  on 1 degrees of freedom, p= 0.3

Student Tasks 2

1. Interpretation of the Chi-square result.

  • Chi-square value = 0.9 with 1 degree of freedom (df = 1).
  • p-value = 0.3 (or more precisely 0.343 from the (O-E)²/V calculation).

The Chi-square value of 0.9 indicates that the difference in survival curves between Treatment A and Treatment B is very small. Since the p-value = 0.3 > 0.05, there is not enough statistical evidence to reject the null hypothesis (H₀: no difference in survival between the two treatment groups). In other words, the difference we see in the Kaplan-Meier plot is not statistically significant.

2. Is Treatment B statistically better?

No. Although Treatment B appears to have higher survival visually (fewer observed events than expected: 5 vs 6.49), the log-rank test shows that this difference is not significant (p = 0.3 > 0.05). It is very likely that this difference is due to random chance (random variation), rather than a true superior effect of Treatment B.

Step 5 - Cox Proportional Hazard Model

cox_health <- coxph(Surv_health ~ treatment + age + gender,
data = healthcare)
summary(cox_health)
## Call:
## coxph(formula = Surv_health ~ treatment + age + gender, data = healthcare)
## 
##   n= 20, number of events= 11 
## 
##                coef exp(coef) se(coef)      z Pr(>|z|)  
## treatmentB -0.68540   0.50389  0.63846 -1.074   0.2830  
## age        -0.13534   0.87341  0.07543 -1.794   0.0728 .
## genderM     0.03021   1.03067  0.69187  0.044   0.9652  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##            exp(coef) exp(-coef) lower .95 upper .95
## treatmentB    0.5039     1.9846    0.1442     1.761
## age           0.8734     1.1449    0.7534     1.013
## genderM       1.0307     0.9702    0.2656     4.000
## 
## Concordance= 0.693  (se = 0.102 )
## Likelihood ratio test= 5.36  on 3 df,   p=0.1
## Wald test            = 4.25  on 3 df,   p=0.2
## Score (logrank) test = 4.59  on 3 df,   p=0.2

Student Tasks 3

1. Interpret the Hazard Ratio for Treatment B.

The Hazard Ratio (HR) for Treatment B is 0.504. This means patients on Treatment B have about 50% lower risk of relapse compared to Treatment A (after adjusting for age and gender). However, this result is not statistically significant (p = 0.283 > 0.05), so we cannot confidently say Treatment B is truly better.

2. Does age increase relapse risk?

No, actually the opposite. For every additional year of age, the risk of relapse decreases by about 13% (HR = 0.873). This effect is close to significant (p = 0.073), suggesting older patients may tend to have lower relapse risk, but it is not quite significant at the 0.05 level.

3. Which variables are significant?

None of the variables are statistically significant at α = 0.05.

  • Treatment B: p = 0.283 (not significant)
  • Age: p = 0.073 (borderline / approaching significance)
  • Gender (male): p = 0.965 (not significant at all)

Overall, the model does not show strong predictive power (Likelihood ratio test p = 0.1, Wald test p = 0.2).

Short Conclusion

The Cox model suggests Treatment B may lower relapse risk and older age may be protective, but no variable reaches statistical significance. The differences seen are still not strong enough to be sure they are real effects (consistent with the earlier log-rank test).

INDUSTRY 2 – MANUFACTURING

Machine Failure Analysis

Business Objective

Determine whether Premium machines last longer than Standard machines.

Step 1 - Input Dataset

library(survival)
library(survminer)

manufacturing <- data.frame(
id = paste0("M",1:20),
type = c(rep("Standard",10), rep("Premium",10)),
time = c(200,350,180,260,300,220,310,190,280,340,
400,320,410,290,360,330,420,310,390,305),
status = c(1,0,1,1,0,1,0,1,1,0,
0,1,0,1,0,1,0,1,0,1),
temp = c(75,72,78,80,74,77,73,79,76,72,
70,68,69,71,67,72,66,70,68,73)
)

Step 2 - Create Survival Object

Surv_machine <- Surv(manufacturing$time,
manufacturing$status)

Step 3 - Kaplan-Meier Curve

km_machine <- survfit(Surv_machine ~ type,
data = manufacturing)
ggsurvplot(km_machine,
data = manufacturing,
pval = TRUE,
risk.table = TRUE)
## Ignoring unknown labels:
## • colour : "Strata"

Student Tasks 1

1. Which machine type lasts longer?

Premium machines last longer overall. The Premium survival curve (red) stays above the Standard curve (blue) throughout the entire time, especially after 200 hours, showing higher survival probability and slower decline.

2. What is survival probability at 300 hours?

  • Premium: ≈ 0.90 (90%)
  • Standard: ≈ 0.50 (50%)

Premium still has high survival with 9 machines at risk at t=300, while Standard has dropped sharply to around 50%.

3. Does Premium appear more reliable?

Yes, visually Premium looks much more reliable. The Premium curve shows clearly delayed failures (fewer early events and higher long-term survival ≈0.45 vs ≈0.35 for Standard). However, the difference is not statistically significant (log-rank p-value = 0.16 > 0.05), so we cannot yet confidently conclude that Premium is truly more durable (it could still be due to random variation).

Step 4 - Cox Model

cox_machine <- coxph(Surv_machine ~ type + temp,
data = manufacturing)
summary(cox_machine)
## Call:
## coxph(formula = Surv_machine ~ type + temp, data = manufacturing)
## 
##   n= 20, number of events= 11 
## 
##                 coef exp(coef) se(coef)      z Pr(>|z|)    
## typeStandard -1.4100    0.2441   0.9467 -1.489 0.136386    
## temp          0.5467    1.7275   0.1510  3.620 0.000294 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##              exp(coef) exp(-coef) lower .95 upper .95
## typeStandard    0.2441     4.0959   0.03818     1.561
## temp            1.7275     0.5789   1.28495     2.323
## 
## Concordance= 0.872  (se = 0.034 )
## Likelihood ratio test= 17.99  on 2 df,   p=1e-04
## Wald test            = 13.69  on 2 df,   p=0.001
## Score (logrank) test = 19.69  on 2 df,   p=5e-05

Student Tasks 2

1. Interpret Hazard Ratio for Premium.

The reference level is Premium, so its Hazard Ratio = 1 (by default). For Standard machines: HR = 0.244 (meaning Standard machines have about 76% lower failure risk compared to Premium). However, this effect is not statistically significant (p = 0.136 > 0.05). After adjusting for operating temperature, there is no strong evidence that Premium machines are more durable — in fact, the direction suggests the opposite.

2. Does higher temperature increase failure risk?

For every 1°C increase in temperature, the failure risk increases by about 73% (HR = 1.728). This effect is highly significant (p = 0.000294 < 0.001, marked ***). Temperature is a very strong and dominant predictor of machine failure.

3. What is the managerial implication?

  • Operating temperature is the most critical factor affecting machine reliability (73% higher risk per °C, extremely significant). Management should prioritize temperature control — better cooling systems, improved ventilation, real-time monitoring, or strict maximum temperature limits — regardless of machine type.
  • The apparent advantage of Premium machines in the Kaplan-Meier plot disappears once temperature is controlled (p = 0.136, not significant). This means the visual difference was likely due to temperature differences between the groups, not the machine design itself.
  • Recommendation: Investing in temperature management will give much bigger and more reliable results than simply buying Premium machines.

Short Conclusion

Temperature is the main driver of machine failure (higher temperature = much higher risk, very significant). After adjusting for temperature, Premium machines are not proven better than Standard ones. So, the strategic focus is control temperature first, that’s where the real impact lies.

INDUSTRY 3 – CUSTOMER ANALYTICS

Time to Customer Churn

Business Objective

Evaluate retention differences between Basic and Pro subscription plans.

Step 1 – Input Dataset

library(survival)
library(survminer)

customer <- data.frame(
id = paste0("C",1:20),
plan = c(rep("Basic",10), rep("Pro",10)),
tenure = c(3,8,5,6,9,4,7,10,2,11,
10,6,12,8,14,7,15,9,13,16),
churn = c(1,0,1,1,0,1,1,0,1,0,
0,1,0,1,0,1,0,1,0,0),
fee = c(rep(20,10), rep(35,10)),
support_calls = c(5,2,4,3,1,6,3,2,7,1,
1,2,0,2,1,3,0,2,1,0)
)

Step 2 – Create Survival Object

Surv_customer <- Surv(customer$tenure,
customer$churn)

Step 3 – Kaplan-Meier Curve

km_customer <- survfit(Surv_customer ~ plan,
data = customer)

ggsurvplot(km_customer,
data = customer,
pval = TRUE,
risk.table = TRUE)
## Ignoring unknown labels:
## • colour : "Strata"

Student Tasks 1

1. Which plan shows better retention?

Pro plan shows clearly better retention. The Pro survival curve (blue) stays above the Basic curve (red) the whole time, dropping more slowly and keeping higher survival (not churning) probabilities at almost every point.

2. What is the probability of surviving ≥ 6 months?

From the Kaplan-Meier plot and risk table:

  • Basic plan: ≈ 0.60 (60%) (The red curve drops to around 0.6 by t=6, with 8 still at risk at t=4.)
  • Pro plan: ≈ 1.00 (100%) (The blue curve stays flat at 1.00 up to t=6, with no churn events before month 6 and 10 still at risk at t=4.)

Overall (both plans combined), it’s around 0.80 (80%), but the gap between plans is obvious.

3. Is the difference statistically significant?

No. The log-rank test p-value = 0.17 (> 0.05). Although Pro looks much better visually (100% survival ≥6 months vs 60% for Basic), the difference is not statistically significant. It could still be due to random chance or the small sample size (only 20 customers), so we cannot confidently say Pro is truly better at preventing churn.

Step 4 – Cox Model

cox_customer <- coxph(Surv_customer ~ plan +
support_calls + fee,
data = customer)
summary(cox_customer)
## Call:
## coxph(formula = Surv_customer ~ plan + support_calls + fee, data = customer)
## 
##   n= 20, number of events= 10 
## 
##                  coef exp(coef) se(coef)     z Pr(>|z|)   
## planPro        0.6690    1.9523   0.8219 0.814  0.41564   
## support_calls  2.3029   10.0031   0.7092 3.247  0.00116 **
## fee                NA        NA   0.0000    NA       NA   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## planPro           1.952    0.51222    0.3899     9.775
## support_calls    10.003    0.09997    2.4917    40.158
## fee                  NA         NA        NA        NA
## 
## Concordance= 0.958  (se = 0.023 )
## Likelihood ratio test= 32.54  on 2 df,   p=9e-08
## Wald test            = 10.63  on 2 df,   p=0.005
## Score (logrank) test = 33.94  on 2 df,   p=4e-08

Student Tasks 2

1. Interpret Hazard Ratio for Pro plan.

The Hazard Ratio (HR) for Pro plan is 1.952. This means customers on the Pro plan have about 95% higher risk of churning compared to Basic (almost twice the risk), after adjusting for support calls and fee. However, this effect is not statistically significant (p = 0.416 > 0.05), so we cannot confidently say the Pro plan increases churn risk, it could be due to random chance.

2. Do support calls increase churn risk?

Each additional support call increases churn risk by about 10 times (HR = 10.003, or 900% higher risk). This effect is highly significant (p = 0.001 < 0.01, marked **). The number of support calls is the strongest and most important predictor of churn in this model.

3. What retention strategy can be derived?

Main focus: Reduce the need for support calls. Customers who contact support frequently are at extremely high churn risk (HR ≈ 10).

Priority actions:

  • Improve product quality and user experience so customers need less help.
  • Build better self-service tools (tutorials, FAQs, AI chatbots, knowledge base).
  • Proactively identify high-risk customers (many support calls) and reach out early (personalized offers, discounts, extra features).

Short Conclusion

Support calls are the biggest driver of churn (10× higher risk per call, very significant). The Pro plan is not proven better or worse after adjusting for support calls. The most effective retention strategy is reduce support call frequency by fixing product issues and improving self-service, that’s where the real impact will come from.

CRITICAL ANALYSIS (REQUIRED)

For each industry, answer:

1. What does censoring represent in this context?

  • Healthcare Industry: Censoring represents patients who have not relapsed by the end of the study (event = 0). This means their data is “censored” because the observation stopped before relapse, so their survival time is only a known minimum (underestimating true risk).
  • Manufacturing Industry: Censoring represents machines that are still working at the end of observation (status = 0). It shows data “censored” because testing ended before failure, making survival time just a lower bound (not full potential duration).
  • Customer Analytics Industry: Censoring represents customers who are still active (not churned) at the end of observation (churn = 0). Their data is “censored” because the study period ended before churn, so tenure is only a minimum estimate of retention.

2. Why is the average time insufficient?

  • Healthcare Industry: Average time ignores censoring, underestimating survival by treating censored patients as “done” too early. Survival analysis (Kaplan-Meier/Cox) is better as it handles censoring and gives time-dependent probabilities (e.g., Treatment B looks better but not significant, p=0.3).
  • Manufacturing Industry: Average time doesn’t account for censoring, biasing results by ignoring or misclassifying still-working machines. Survival models are more accurate, integrating factors like temperature (HR=1.73, significant), which dominates over machine type (p=0.136).
  • Customer Analytics Industry: Average time fails to handle censoring, overestimating retention by assuming active customers stay forever. Survival analysis reveals support calls as the main driver (HR=10, significant), not the plan (p=0.416), which averages hide.

3. What strategic decision can management make?

  • Healthcare Industry: Prioritize further research on age (HR=0.87, borderline p=0.073) for personalized treatments in older patients. Since treatments show no significant difference (p=0.283), focus resources on long-term monitoring rather than favoring one treatment.
  • Manufacturing Industry: Focus on controlling operating temperature (HR=1.73 per °C, p<0.001) with better cooling and monitoring to reduce failures. As Premium type isn’t significantly better (p=0.136), avoid expensive upgrades; temperature optimization is more cost-effective.
  • Customer Analytics Industry: Reduce churn by minimizing support calls (HR=10 per call, p=0.001) through product improvements, self-service tools, and proactive interventions. Since Pro plan isn’t significant (p=0.416), don’t rely on upgrades; enhance user experience for lasting retention.

4. What would happen if we used linear regression instead?

  • Healthcare Industry: Linear regression would misestimate by ignoring censoring (assuming all data complete), biasing coefficients and losing time-dependent info. It might overestimate treatment effects (e.g., miss age as protective), without accurate HR.
  • Manufacturing Industry: Linear regression ignores censoring, underestimating machine duration and biasing estimates (e.g., missing temperature’s strong role). It could wrongly conclude Premium is better, without capturing time-varying hazards (like progressive temperature effects).
  • Customer Analytics Industry: Linear regression fails on censoring, overestimating retention and misinterpreting (e.g., ignoring support calls’ exponential risk). Without handling incomplete data, the model would be invalid, missing that plan isn’t the key factor.

Overall Conclusion

Survival analysis excels by handling censoring and covariates, revealing key factors like age (healthcare), temperature (manufacturing), and support calls (customer). Management can make evidence-based decisions for efficiency, while linear regression would be misleading due to wrong assumptions on censored data.

REFERENSI

  1. Siregar, B. (n.d.). Introduction to Survival Analysis in R. RPubs. https://rpubs.com/dsciencelabs/intro?authuser=0

  2. Therneau, T. M. (2023). A Package for Survival Analysis in R. R package version 3.5-7. Comprehensive R Archive Network (CRAN). https://CRAN.R-project.org/package=survival

  3. Kassambara, A., Kosinski, M., & Biecek, P. (2021). survminer: Drawing Survival Curves using ‘ggplot2’. R package version 0.4.9. Comprehensive R Archive Network (CRAN). https://CRAN.R-project.org/package=survminer

  4. Kleinbaum, D. G., & Klein, M. (2012). Survival Analysis: A Self-Learning Text (3rd ed.). Springer. https://link.springer.com/book/10.1007/978-1-4419-6646-9

  5. Collett, D. (2015). Modelling Survival Data in Medical Research (3rd ed.). Chapman and Hall/CRC. https://www.taylorfrancis.com/books/mono/10.1201/b18190/nutrition-fertility-human-reproductive-function-karma-pearce-kelton-tremellen

  6. Hosmer, D. W., Lemeshow, S., & May, S. (2008). Applied Survival Analysis: Regression Modeling of Time-to-Event Data (2nd ed.). Wiley. https://doi.org/10.1002/9780470258019