time-to-event-methodslisted
Install: claude install-skill choxos/BiostatAgent
# Time-to-Event Methods
## When to Use This Skill
- Selecting appropriate analysis methods for survival endpoints
- Handling non-proportional hazards scenarios
- Implementing weighted logrank tests
- Designing MaxCombo tests
- Using RMST or milestone endpoints
## Analysis Methods Overview
### Standard Logrank Test
**When Optimal:**
- Proportional hazards assumption holds
- Treatment effect constant over time
**Formula:**
```
Z = Σ(O_trt - E_trt) / √(Var)
```
**simtrial Implementation:**
```r
data |> wlr(weight = fh(rho = 0, gamma = 0))
```
### Fleming-Harrington Weighted Logrank
**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:**
```r
# Late emphasis
data |> wlr(weight = fh(rho = 0, gamma = 0.5))
# Early emphasis
data |> wlr(weight = fh(rho = 1, gamma = 0))
```
### Magirr-Burman (MB) Weights
**Design:** Zero weight before delay, then increasing weight.
**Parameters:**
- `delay`: Time before weights increase
- `w_max`: Maximum weight cap
**Formula:**
```
w(t) = min(w_max, S(min(t, τ*))^(-1))
```
**When to Use:**
- Known delay in treatment effect
- Clear scientific rationale for delay period
**simtrial I