Module 1 · Homework 1

Worked answers with reasoning. References point to the lecture notes PDF and the notes pages.

← Back to notes index

Q1 — Relationship between $\lambda(t)$ and $S(t)$

Answer: Knowing $\lambda(t)$ over time uniquely determines $S(t)$, as $S(t) = \exp\left(-\int_0^t \lambda(u)\,du\right)$.

This is the key identity $S(t) = e^{-\Lambda(t)}$ with $\Lambda(t) = \int_0^t \lambda(u)\,du$ — any one of the five functions ($f$, $F$, $S$, $\lambda$, $\Lambda$) determines the rest.

Why the others are wrong:

Q2 — Informative censoring

Answer: A patient is lost to follow-up because they are moved into hospice care at a nursing home due to rapidly declining health.

Censoring is informative when the censoring time carries information about the event time ($U_i$ and $T_i$ dependent). Hospice transfer due to rapidly declining health censors exactly the patients closest to death — a patient censored this way is not representative of the others who survived to that time, and survival would be overestimated.

The other three are noninformative:

Q3 — Exponential: $P(T > t+s \mid T > t)$

Answer: $\exp{-\lambda s}$.

Since ${T > t+s} \subset {T > t}$, the intersection is just ${T > t+s}$:

\[P(T > t+s \mid T > t) = \frac{P(T > t+s,\; T > t)}{P(T > t)} = \frac{P(T > t+s)}{P(T > t)} = \frac{S(t+s)}{S(t)}\]

With the exponential $S(t) = e^{-\lambda t}$:

\[\frac{e^{-\lambda(t+s)}}{e^{-\lambda t}} = e^{-\lambda s}\]

This is the memoryless property: having already survived $t$ changes nothing — the constant hazard means the clock effectively restarts.

Distractors: $e^{-\lambda t}$ is the unconditional $S(t)$; $\frac{\lambda^s}{s!}e^{-\lambda}$ is the Poisson pmf; the normal-density expression is irrelevant; and the information given is sufficient.

Q4 — Exponential discharge times (memoryless in action)

Answer: 0.60

Setup: $T \sim \text{Exponential}(\lambda)$, with $P(T \le 4) = 0.6$. Asked: $P(T < 10 \mid T > 6)$.

No need to even solve for $\lambda$: the conditioning window is $10 - 6 = 4$ days — the same width as the given probability’s window. By the memoryless property (Q3),

\[P(T < 10 \mid T > 6) = 1 - P(T > 10 \mid T > 6) = 1 - P(T > 4) = P(T \le 4) = 0.6\]

Having already stayed 6 days changes nothing; the clock restarts, and “discharged within the next 4 days” has the same probability as it did on day zero.

Verification the long way (q4.R): solve $1 - e^{-4\lambda} = 0.6 \Rightarrow \lambda = -\log(0.4)/4 \approx 0.2291$, then

\[P(T < 10 \mid T > 6) = \frac{S(6) - S(10)}{S(6)} = 0.6 \quad\checkmark\]

Rounded to 2 decimals: 0.60.

Q5 — Weibull hazard shapes

Answer: The hazard function is increasing for $k > 1$, decreasing for $k < 1$, and constant for $k = 1$.

The Weibull hazard is

\[\lambda(t) = k\lambda(\lambda t)^{k-1}\]

and its time-dependence sits entirely in the factor $(\lambda t)^{k-1}$:

Shape Exponent $k-1$ Hazard Interpretation
$k > 1$ positive increasing wear-out / ageing
$k = 1$ zero constant $= \lambda$ reduces to the exponential
$0 < k < 1$ negative decreasing early failures

The other options claim a single behavior “for all $k$” — impossible: the shape parameter’s entire purpose is to let the hazard move either way (that flexibility over the exponential’s constant hazard is why the Weibull is used at all).

Q6 — Advantage of Weibull over exponential

Answer: The Weibull distribution can model both increasing and decreasing hazard rates, whereas the exponential can only model a constant hazard.

Follows directly from Q5: the shape parameter $k$ frees the hazard to rise ($k > 1$) or fall ($k < 1$), while the exponential is locked to $\lambda(t) = \lambda$ — and the Weibull keeps simple closed forms for $S$, $\lambda$, $\Lambda$ while doing it.

Why the others are wrong:

Q7 — Censored likelihood

Answer:

\[L(\theta) = \prod_i f(t_i \mid \theta)^{\delta_i}\, S(t_i \mid \theta)^{1-\delta_i}\]

The exponents are a switch ($f^1 S^0 = f$ vs. $f^0 S^1 = S$), and independent subjects multiply.

Why the others are wrong:

Q8 — Exponential MLE after a censoring correction

Answer: $-0.05$

The censored exponential MLE is

\[\hat\lambda = \frac{\sum_i \delta_i}{\sum_i x_i} = \frac{\text{\# events}}{\text{total observed time}}\]

Correcting patient 5 from event to censored leaves the denominator unchanged — $\sum x_i = 20.9$ either way, since censored subjects still contribute their observation time — and drops the event count from 3 to 2:

\[\hat\lambda_{new} - \hat\lambda_{old} = \frac{2}{20.9} - \frac{3}{20.9} = -\frac{1}{20.9} = -0.0478 \approx \mathbf{-0.05}\]

Sign check: an event reclassified as censored means less observed failure over the same exposure → lower estimated hazard.

Script: q8.R — includes a survreg cross-check ($\lambda = e^{-\text{Intercept}}$), matching to all decimals.

Q9 — Median survival time

Answer: the time $k$ at which $S(k) = 0.5$.

Median survival $\tau$ is defined by $S(\tau) = 0.5$: half the population still event-free.

Why the others are wrong:

Q10 — Nonparametric estimation of survival

Answer: Kaplan–Meier estimator.

The most commonly used nonparametric estimate of $S(t)$ — no distributional assumption, built from risk sets via the product-limit construction.

Q11 — Interval censoring

Answer: the exact moment the event occurred is unknown; it is only known that it occurred within a certain interval.

The lecture example: diabetes trials with fasting glucose measured every 6 months — a diagnosis at test time $R_i$ places the true onset within $(L_i, R_i)$, between the previous and current tests. The event is “silent”; only the bracketing interval is observed.

Q12–Q14 — KM, Nelson–Aalen, Fleming–Harrington

Data: $x = (190, 47, 5, 84, 89, 103, 311)$, $\delta = (1,1,0,1,0,1,0)$. Events at 47, 84, 103, 190; censored at 5, 89, 311. Risk-set table:

$t_{(k)}$ $n_k$ $d_k$ $1 - d_k/n_k$ $\hat{S}_{KM}$ $d_k/n_k$ $\hat\Lambda_{NA}$
47 6 1 5/6 0.8333 1/6 0.1667
84 5 1 4/5 0.6667 1/5 0.3667
103 3 1 2/3 0.4444 1/3 0.7000
190 2 1 1/2 0.2222 1/2 1.2000

Q12 — Kaplan–Meier $\hat{S}(100)$: 0.67

Events at or before 100: 47 and 84.

\[\hat{S}_{KM}(100) = \tfrac{5}{6}\cdot\tfrac{4}{5} = \tfrac{2}{3} = 0.6667 \to \mathbf{0.67}\]

Q13 — Nelson–Aalen $\hat\Lambda(85)$: 0.37

\[\hat\Lambda_{NA}(85) = \sum_{k:\,t_{(k)}\le 85} \frac{d_k}{n_k} = \tfrac{1}{6} + \tfrac{1}{5} = 0.3667 \to \mathbf{0.37}\]

Q14 — Fleming–Harrington $\hat{S}(190)$: 0.30

\[\hat\Lambda_{NA}(190) = \tfrac{1}{6} + \tfrac{1}{5} + \tfrac{1}{3} + \tfrac{1}{2} = 1.2 \qquad \hat{S}_{FH}(190) = e^{-1.2} = 0.3012 \to \mathbf{0.30}\]

Close to but not equal to $\hat{S}_{KM}(190) = 0.222$ — as expected of the two estimators.

Script: q12_14.R — hand computations plus survfit cross-checks (KM; ctype=1 cumhaz for Nelson–Aalen; type="fh" for Fleming–Harrington), all matching.

Q15 — Exponential with mean 5 years: $P(T \le 1)$

Answer: 0.18

The parametrization trap: for the exponential, mean survival is $\mu = 1/\lambda$ — so mean 5 years gives $\lambda = 1/5 = 0.2$, not $5$.

\[P(T \le 1) = F(1) = 1 - e^{-0.2 \cdot 1} = 0.1813 \to \mathbf{0.18}\]

Script: q15.R (with pexp check).