Skip to Content
Think Stats 第3版 ―Pythonで学ぶ統計学入門
book

Think Stats 第3版 ―Pythonで学ぶ統計学入門

by Allen B. Downey, 大橋 真也
October 2025
Intermediate to advanced
328 pages
3h 56m
Japanese
O'Reilly Japan, Inc.
Content preview from Think Stats 第3版 ―Pythonで学ぶ統計学入門

13章生存時間解析

生存時間解析とは、物事がどれだけ持続するかを記述する手法です。人間の寿命を研究するためによく用いられますが、機械部品や電子部品の「生存」、あるいはより一般的に、あらゆる種類の事象が発生するまでの時間間隔、さらには空間的な間隔にも適用できます。

まず簡単な例として電球の寿命から始め、次に米国における過去50年間の初婚年齢の変化という、より実質的な例を考察します。

13.1 生存関数

生存時間解析の基本概念は生存関数であり、これは特定の期間を超えて生存する集団の割合を示します。最初の例として、電球の寿命に関する生存関数を計算します。

2007年に実施された実験データを使います。研究者たちは50個の新しい電球を設置し、連続点灯させました。彼らは12時間ごとに電球をチェックし、寿命が切れた電球の寿命を記録し、50個すべての電球の寿命が切れるまで実験を続けました。データのダウンロード方法は13章のノートブック(chap13.ipynb)で説明しています。

データは以下のように読み込めます。

df = pd.read_csv("lamps.csv", index_col=0)
df.tail()
ihfK
28181214
29183613
30186012
31198011
32256810

h列には、寿命が時間単位で記録されており、f列には、hの各値で寿命を迎えた電球の数が記録されています。寿命の分布を表すために、これらの値をPmfオブジェクトに入れ、正規化します。

from empiricaldist import Pmf

pmf_bulblife = Pmf(df["f"].values, index=df["h"])
pmf_bulblife.normalize() ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

SRE サイトリライアビリティエンジニアリング ―Googleの信頼性を支えるエンジニアリングチーム

SRE サイトリライアビリティエンジニアリング ―Googleの信頼性を支えるエンジニアリングチーム

Betsy Beyer, Chris Jones, Jennifer Petoff, Niall Richard Murphy, 澤田 武男, 関根 達夫, 細川 一茂, 矢吹 大輔, Sky株式会社 玉川 竜司
MLOps実装ガイド ―本番運用を見据えた開発戦略

MLOps実装ガイド ―本番運用を見据えた開発戦略

Yaron Haviv, Noah Gift, 井伊 篤彦, 入江 美穂, 張 凡, 樋口 千洋

Publisher Resources

ISBN: 9784814401376Publisher Website