agentsclimarketplace

R survival analysis with cox model and double brackets

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/r-survival-analysis-with-cox-model-and-double-brackets

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill r-survival-analysis-with-cox-model-and-double-brackets

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

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

SKILL.md

1.8 KB, 283 tokens by cl100k_base, as published. Nobody here has run it

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 [[]]

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.