累積ハザード
4 つの市場グループにおける医薬品発売の Nelson–Aalen 累積ハザード(95% 帯付き)。

累積ハザード H(t) は、イベントの瞬間的なリスクを時間にわたって足し合わせたもので、「これまでに蓄積されたリスク」を表し、S(t) = exp(−H(t)) によって生存関数と結び付いています。生存曲線と異なり 1 で上限が抑えられることはなく、その 傾き がハザードそのものです。直線ならリスクは一定、上向きに曲がる曲線なら時間とともにリスクが増加していることを意味します。
設定は Hadengue, de Marcellis-Warin & Warin (2015, Management international) で、医薬品分野におけるリバース・イノベーションと逆方向の技術移転を扱っています。ここでのデータは説明のために シミュレーション したもので、論文のデータや結果ではありません。医薬品と市場の組 400 件について、世界で最初に承認されてから特定の市場で発売されるまでの年数を 4 つの市場グループごとに測っています。観測終了時点で未発売の医薬品は打ち切りとして扱います。曲線は lifelines.NelsonAalenFitter によるもので、サブタイトルには 4 グループ間のログランク検定(multivariate_logrank_test)を示しています。横軸は 6 年で止めています。それ以降は、発売の速いグループでリスク集合に残る医薬品が少なすぎるためです。
コードおよび図中のテキストは英語です。
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from lifelines import NelsonAalenFitter
from lifelines.statistics import multivariate_logrank_test
# Simulated data, set in the context of Hadengue, de Marcellis-Warin & Warin (2015) [hadengue2015]
# Data: years from first approval to launch, 100 drugs in each of four market groups
rng = np.random.default_rng(2015)
rates = {"United States": 0.5, "Western Europe": 0.33, "Japan": 0.22, "China": 0.12} # launches per year
df = pd.concat([pd.DataFrame({"market": m, "launch": rng.weibull(1.3, 100) / r}) for m, r in rates.items()])
cens = rng.uniform(2, 10, len(df)) # end of observation for each drug
df["years"], df["launched"] = np.minimum(df.launch, cens), (df.launch <= cens).astype(int)
colors = ["#007AFF", "#34C759", "#FF9500", "#FF3B30"]
fig, ax = plt.subplots(figsize=(8, 5))
# Nelson–Aalen estimate with 95% CI, one curve per market group, first 6 years, while enough drugs remain at risk
for g, c in zip(rates, colors):
d = df[df.market == g]
naf = NelsonAalenFitter().fit(d.years, d.launched, label=g)
H, ci = naf.cumulative_hazard_[g].loc[:6].copy(), naf.confidence_interval_.loc[:6].copy()
H.loc[6], ci.loc[6] = H.iloc[-1], ci.iloc[-1]
ax.step(H.index, H, where="post", color=c, lw=2, label=f"{g} (n = {len(d)}, {d.launched.sum()} launches)")
ax.fill_between(ci.index, ci.iloc[:, 0], ci.iloc[:, 1], step="post", color=c, alpha=0.13, lw=0)
# Log-rank test across market groups
lr = multivariate_logrank_test(df.years, df.market, df.launched)
p_txt = "p < .001" if lr.p_value < 0.001 else f"p = {lr.p_value:.3f}"
ax.legend(loc="upper left")
ax.set(xlabel="Years since first approval anywhere", ylabel="Cumulative hazard of launch H(t)",
xlim=(0, 6), xticks=range(7), ylim=(0, None))
ax.set_title("Nelson–Aalen cumulative hazard of launch for four market groups", pad=26)
ax.text(0, 1.02, f"Nelson–Aalen with 95% CI · log-rank χ²({lr.degrees_of_freedom}) = "
f"{lr.test_statistic:.1f}, {p_txt} · n = {len(df)} drug–market pairs (simulated), "
f"{df.launched.sum()} launches", transform=ax.transAxes, fontsize=9.5, color="#6E6E73")
plt.show()
図にはオプションの PyStatlas スタイル を使用しています。同じ見た目にするには plt.style.use("pystatlas.mplstyle") を追加してください。
データの出典
- Simulated data. Simulated data with a fixed random seed, created for this example.
No real respondents, documents or measurements: the numbers only illustrate how the chart and its statistics work. - Hadengue, de Marcellis-Warin & Warin (2015), reverse innovation in pharmaceuticals. Hadengue, M., de Marcellis-Warin, N., & Warin, T. (2015). Reverse innovation and reverse technology transfer: From made in China to discovered in China in the pharmaceutical sector. Management international, 19(4), 49–69. https://doi.org/10.7202/1043076ar
The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
これらの例は統計手法を説明するためのものです。項目に別の記載がない限り数値はシミュレーションであり、図のタイトルはこのシミュレーションデータで図が示す内容を述べたものです。引用した論文の知見でも、実質的な問いに対する著者の立場でもありません。結果、背景、データについては、ここに挙げた論文を参照してください。
引用方法
PyStatlas は Thierry Warin が作成・運営しています。研究や業務に役立った場合は、ぜひ引用してください。
Warin, T. (2026). Cumulative hazard. In PyStatlas: A Python Gallery of Statistical Graphics for the Social Sciences (Version 1.1.0) [Computer software]. https://warin.ca/pystatlas/survival/cumulative-hazard/
@misc{warin2026statlas,
author = {Warin, Thierry},
title = {PyStatlas: A Python Gallery of Statistical Graphics for the Social Sciences},
year = {2026},
version = {1.1.0},
howpublished = {\url{https://warin.ca/pystatlas/}},
note = {Source code: https://github.com/warint/pystatlas}
}