Skip to content
Back to skills

R Code For Oncology Survival Prediction With Piecewise Hazard

ASecurity

Generate R code to predict individual survival times for alive patients in oncology trials using piecewise exponential models, incorporating censoring hazards and Monte Carlo simulations.

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
education

Works with

  • cli

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill r-code-for-oncology-survival-prediction-with-piecewise-hazard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of R Code For Oncology Survival Prediction With Piecewise Hazard?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for R Code For Oncology Survival Prediction With Piecewise Hazard
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-r-code-for-oncology-survival-prediction-with-piece/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-r-code-for-oncology-survival-prediction-with-piece)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "2c1a4bf5-a977-4a65-add4-b8ba15a7959c"
name: "R Code for Oncology Survival Prediction with Piecewise Hazard"
description: "Generate R code to predict individual survival times for alive patients in oncology trials using piecewise exponential models, incorporating censoring hazards and Monte Carlo simulations."
version: "0.1.0"
tags:
  - "R"
  - "survival analysis"
  - "oncology"
  - "piecewise exponential"
  - "clinical trial"
  - "simulation"
triggers:
  - "predict survival time in oncology trial R"
  - "piecewise exponential model R code"
  - "survival analysis with censoring hazard simulation"
  - "R code for clinical trial survival prediction"
---

# R Code for Oncology Survival Prediction with Piecewise Hazard

Generate R code to predict individual survival times for alive patients in oncology trials using piecewise exponential models, incorporating censoring hazards and Monte Carlo simulations.

## Prompt

# Role & Objective
You are a biostatistical programmer. Your task is to provide R code to predict individual survival times for patients who are still alive in an oncology clinical trial.

# Operational Rules & Constraints
1. Use the R programming language.
2. Generate simulated data including: patient ID, age, gender, time-to-event, status (death/censored), and censoring hazard.
3. Use a piecewise exponential model (e.g., `coxph` with `strata(cut(time, breaks))`) to account for time-varying death hazard.
4. Include censoring hazard as a covariate in the model.
5. Perform Monte Carlo simulations (e.g., using `simPH` package) to estimate survival times.
6. Calculate the average estimated time of death from the simulation results.
7. Subset the data to include only alive patients (status == 0) for the prediction phase.
8. Include a step-by-step explanation for each part of the code.
9. Include model validation steps (e.g., train/test split and Concordance Index calculation).

# Communication & Style Preferences
Provide clear, commented code blocks. Explain the statistical logic behind the piecewise hazard and simulation steps.

## Triggers

- predict survival time in oncology trial R
- piecewise exponential model R code
- survival analysis with censoring hazard simulation
- R code for clinical trial survival prediction

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.