Survival analysis methods including weighted logrank, MaxCombo, RMST, and milestone tests. Use when analyzing TTE data or choosing analysis methods for non-proportional hazards.
/plugin marketplace add choxos/ClinicalTrialAgent/plugin install choxos-clinical-trial-simulation-plugins-clinical-trial-simulation@choxos/ClinicalTrialAgentThis skill inherits all available tools. When active, it can use any tool Claude has access to.
When Optimal:
Formula:
Z = Σ(O_trt - E_trt) / √(Var)
simtrial Implementation:
data |> wlr(weight = fh(rho = 0, gamma = 0))
Weight Function:
w(t) = S(t)^ρ × (1 - S(t))^γ
Parameter Effects:
| ρ | γ | Emphasis | Best For |
|---|---|---|---|
| 0 | 0 | Uniform (standard LR) | Proportional hazards |
| 0 | 0.5 | Moderate late | Moderate delayed effect |
| 0 | 1 | Strong late | Strong delayed effect |
| 1 | 0 | Early | Early divergence |
| 0.5 | 0.5 | Balanced | Crossing hazards |
simtrial Implementation:
# Late emphasis
data |> wlr(weight = fh(rho = 0, gamma = 0.5))
# Early emphasis
data |> wlr(weight = fh(rho = 1, gamma = 0))
Design: Zero weight before delay, then increasing weight.
Parameters:
delay: Time before weights increasew_max: Maximum weight capFormula:
w(t) = min(w_max, S(min(t, τ*))^(-1))
When to Use:
simtrial Implementation:
# 4-month delay, max weight 2
data |> wlr(weight = mb(delay = 4, w_max = 2))
# Unlimited weight growth
data |> wlr(weight = mb(delay = 6, w_max = Inf))
Design: Exactly zero weight for early period, then standard logrank.
When to Use:
simtrial Implementation:
# Zero weight for first 6 months
data |> wlr(weight = early_zero(early_period = 6))
Concept: Combine multiple weighted logrank tests, take maximum Z-score.
Advantages:
Common Combinations:
| Combo | Tests | Use Case |
|---|---|---|
| 2-test | FH(0,0) + FH(0,1) | Unknown late effect |
| 3-test | FH(0,0) + FH(0,0.5) + FH(0.5,0.5) | Comprehensive |
| Custom | FH(0,0) + FH(0,1) + FH(1,1) | Maximum robustness |
simtrial Implementation:
# Two-test MaxCombo
data |> maxcombo(rho = c(0, 0), gamma = c(0, 1))
# Three-test MaxCombo
data |> maxcombo(rho = c(0, 0, 0.5), gamma = c(0, 0.5, 0.5))
Correlation Handling: MaxCombo accounts for correlation between tests using multivariate normal distribution.
Definition: Area under survival curve up to time τ.
Formula:
RMST(τ) = ∫₀^τ S(t) dt
Advantages:
Considerations:
simtrial Implementation:
data |> rmst(tau = 24) # RMST at 24 months
Definition: Compare survival probability at fixed time point.
Test Statistic:
Z = (S_trt(t*) - S_ctrl(t*)) / SE
Advantages:
simtrial Implementation:
data |> milestone(ms_time = 12, test_type = "naive")
Pattern: HR = 1 initially, then HR < 1
Analysis Recommendations:
Simulation Setup:
fail_rate <- data.frame(
stratum = rep("All", 4),
period = rep(1:2, 2),
treatment = c(rep("control", 2), rep("experimental", 2)),
duration = c(4, 100, 4, 100), # 4-month delay
rate = log(2) / c(12, 12, 12, 18) # HR=1 then HR=0.67
)
Pattern: Early benefit reverses over time
Analysis Recommendations:
Pattern: Strong early effect that wanes
Analysis Recommendations:
Pattern: Proportion of patients cured (never event)
Analysis Recommendations:
START
│
├─ Is proportional hazards expected?
│ ├─ Yes → Standard logrank FH(0,0)
│ └─ No → Continue
│
├─ Is delayed effect expected?
│ ├─ Yes, delay known → MB weights
│ ├─ Yes, delay uncertain → FH(0, 0.5) or MaxCombo
│ └─ No → Continue
│
├─ Is crossing possible?
│ ├─ Yes → RMST or FH(0.5, 0.5)
│ └─ No → Continue
│
├─ Maximum robustness needed?
│ ├─ Yes → MaxCombo
│ └─ No → FH(0, γ) based on expected pattern
│
END
| Method | Relative Power |
|---|---|
| Logrank FH(0,0) | 100% (optimal) |
| FH(0, 0.5) | ~95% |
| MaxCombo | ~98% |
| RMST | ~90% |
| Method | Relative Power |
|---|---|
| Logrank FH(0,0) | 70% |
| FH(0, 0.5) | 90% |
| MB(delay=3) | 95% |
| MaxCombo | 92% |
| Method | Relative Power |
|---|---|
| Logrank FH(0,0) | Variable |
| FH(0.5, 0.5) | Better |
| RMST | Depends on τ |
| MaxCombo | Robust |
This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.