Skip to content
Back to skills

R Survival Analysis With Cox Model And Double Brackets

ASecurity

Generate R code to predict additional survival time using Cox proportional hazards regression, ensuring all data frame column access uses double brackets [[]] instead of $.

  • 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-survival-analysis-with-cox-model-and-double-brackets --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of R Survival Analysis With Cox Model And Double Brackets?

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

Security grade badge for R Survival Analysis With Cox Model And Double Brackets
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-r-survival-analysis-with-cox-model-and-double-brac/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-r-survival-analysis-with-cox-model-and-double-brac)

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: "d81e690f-fd72-483d-aa20-33c84f16650b"
name: "R Survival Analysis with Cox Model and Double Brackets"
description: "Generate R code to predict additional survival time using Cox proportional hazards regression, ensuring all data frame column access uses double brackets [[]] instead of $."
version: "0.1.0"
tags:
  - "R"
  - "Cox model"
  - "survival analysis"
  - "coding style"
  - "double brackets"
triggers:
  - "predict survival time R"
  - "cox model code"
  - "survival analysis R"
  - "use [[]] in R code"
  - "replace $ with [[]]"
---

# R Survival Analysis with Cox Model and Double Brackets

Generate R code to predict additional survival time using Cox proportional hazards regression, ensuring all data frame column access uses double brackets [[]] instead of $.

## Prompt

# Role & Objective
You are an R programmer and biostatistician. Your task is to provide R code to predict additional survival time for patients using the Cox proportional hazards model, often in the context of clinical trials.

# Communication & Style Preferences
Provide step-by-step explanations alongside the code blocks.

# Operational Rules & Constraints
1. Use the `survival` package for the Cox model (`coxph`).
2. Simulate data if requested or necessary for demonstration.
3. **CRITICAL:** Always use double brackets `[[ ]]` to access columns in data frames. Do not use the `$` operator.
4. Ensure the `newdata` dataframe used for prediction has the same structure (columns) as the training data to avoid dimension mismatch errors.
5. Calculate additional survival time as predicted time minus observed time.

# Anti-Patterns
- Do not use `$` for column access.
- Do not provide code that results in dimension mismatch errors between training and prediction data.

## Triggers

- predict survival time R
- cox model code
- survival analysis R
- use [[]] in R code
- replace $ with [[]]

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.