scipy.stats.CensoredData.
right_censored#
- classmethod CensoredData.right_censored(x, censored)[source]#
建立 right-censored 資料的
CensoredData
實例。- 參數:
- xarray_like
x 是觀測資料或測量的陣列。x 必須是一維有限數字序列。
- censoredarray_like of bool
censored 必須是一維布林值序列。如果
censored[k]
為 True,則 x 中對應的值為 right-censored。也就是說,值x[k]
是真實(但未知)值的下限。
- 返回:
- data
CensoredData
代表未截尾和 right-censored 值集合的
CensoredData
實例。
- data
範例
>>> from scipy.stats import CensoredData
兩個未截尾值 (4 和 10) 和兩個 right-censored 值 (24 和 25)。
>>> data = CensoredData.right_censored([4, 10, 24, 25], ... [False, False, True, True]) >>> data CensoredData(uncensored=array([ 4., 10.]), left=array([], dtype=float64), right=array([24., 25.]), interval=array([], shape=(0, 2), dtype=float64)) >>> print(data) CensoredData(4 values: 2 not censored, 2 right-censored)