Module Import alias identifier Import alias identifier ImportFrom alias alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num Slice Num Assign NameStore Call AttributeLoad NameLoad attr CompareGt NameLoad Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpSub Num BinOpDiv NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpDiv NameLoad Call AttributeLoad BinOpMult NameLoad BinOpSub NameLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AugAssignMult NameStore NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr IfExp UnaryOpNot NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr CompareLt AttributeLoad NameLoad attr BinOpSub Num NameLoad If CompareEq Call NameLoad NameLoad Num body Return AttributeLoad NameLoad attr Return SubscriptLoad AttributeLoad NameLoad attr Index SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr BinOpSub Num BinOpDiv NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr UnaryOpUSub Call AttributeLoad NameLoad attr NameLoad Assign NameStore Lambda arguments args NameParam defaults BinOpDiv Num BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Lambda arguments args NameParam defaults NameLoad Assign NameStore Lambda arguments args NameParam defaults Num orelse If CompareEq NameLoad Str body Assign NameStore Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr NameLoad Assign NameStore Lambda arguments args NameParam defaults BinOpDiv Num NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr BinOpDiv NameLoad BinOpSub Num NameLoad Assign NameStore Lambda arguments args NameParam defaults BinOpDiv Num BinOpMult NameLoad BinOpSub Num NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Lambda arguments args NameParam defaults BinOpDiv Num BinOpMult BinOpMult Num Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr BinOpSub Num NameLoad orelse Raise Call NameLoad Str Assign NameStore BinOpSub Call NameLoad AttributeLoad NameLoad attr Call NameLoad BinOpSub Num NameLoad AugAssignDiv NameStore BinOpMult Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr CompareLtE Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Return TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index SubscriptLoad NameLoad Index Num If CompareEq SubscriptLoad NameLoad Index Num BinOpSub Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index BinOpAdd SubscriptLoad NameLoad Index Num Num Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Str Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq NameLoad Str body Raise Call NameLoad Str If CompareNotEq NameLoad Num body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpDiv BinOpPow AttributeLoad NameLoad attr Num BinOpPow AttributeLoad NameLoad attr Num Assign NameStore AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpDiv BinOpMult Num BinOpAdd Num BinOpMult NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpPow AttributeLoad NameLoad attr BinOpDiv Num NameLoad Assign NameStore BinOpPow AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Num AugAssignMult NameStore BinOpDiv BinOpAdd Num BinOpMult NameLoad NameLoad BinOpMult Num Call AttributeLoad NameLoad attr NameLoad AugAssignMult NameStore Call AttributeLoad NameLoad attr BinOpDiv AttributeLoad NameLoad attr BinOpSub Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad Num AttributeLoad NameLoad attr Assign NameStore BinOpPow Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad UnaryOpUSub AttributeLoad NameLoad attr BinOpDiv AttributeLoad NameLoad attr Num Assign NameStore BinOpPow Call AttributeLoad NameLoad attr NameLoad Num orelse Raise Call NameLoad Str Return TupleLoad NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq Call NameLoad NameLoad Num body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore TupleLoad Num Num For NameStore NameLoad body Assign NameStore CompareEq NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad NameLoad NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad Assign NameStore BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpPow NameLoad Num Assign NameStore BinOpSub Num Call AttributeLoad NameLoad attr NameLoad Num Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults kwarg body Assign NameStore CompareEq NameLoad SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore CompareEq NameLoad SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore ListLoad For NameStore TupleLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign SubscriptStore NameLoad Index Num Num Assign NameStore BinOpSub Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore BinOpDiv NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpDiv BinOpMult BinOpMult BinOpMult NameLoad NameLoad BinOpSub Num NameLoad BinOpSub NameLoad NameLoad BinOpSub NameLoad Num Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Str body If CompareNotIn Str NameLoad body Raise Call NameLoad Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore BinOpSub Num BinOpDiv NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpPow NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign SubscriptStore NameLoad Index Num Num orelse Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr CompareGt NameLoad Num If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpPow SubscriptLoad NameLoad Index NameLoad Num SubscriptLoad NameLoad Index NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body Assert CompareIs Call NameLoad SubscriptLoad NameLoad Index Num NameLoad handlers ExceptHandler body Assign NameStore ListLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad ListLoad Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad ListLoad Num AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr If CompareGt NameLoad SubscriptLoad NameLoad Index Num body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad ListLoad SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad Str BinOpMod Str BinOpAdd NameLoad Num Assign TupleStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str keyword NameLoad keyword Num keyword Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad NameLoad Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str keyword Num keyword Call AttributeLoad NameLoad attr keyword BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr Num Num Return NameLoad decorator_list
N/A N/A numpy np N/A pandas pd scipy.stats.distributions chi2 norm statsmodels.graphics utils _calc_survfunc_right N/A N/A time status N/A N/A N/A 
    Calculate the survival function and its standard error for a single
    group.
     N/A time N/A N/A np asarray time N/A status N/A N/A np asarray status N/A N/A time rtime N/A N/A np unique time return_inverse True N/A d N/A N/A np bincount rtime weights status N/A n N/A N/A np bincount rtime N/A n N/A N/A N/A np cumsum N/A n N/A -1 N/A -1 N/A ii N/A N/A np flatnonzero N/A d 0 N/A d N/A d N/A ii N/A n N/A n N/A ii N/A time N/A time N/A ii N/A sp N/A 1 N/A d N/A N/A n astype N/A np float64 N/A sp N/A N/A np log sp N/A sp N/A N/A np cumsum sp N/A sp N/A N/A np exp sp N/A se N/A d N/A N/A N/A n N/A n d astype N/A np float64 N/A se N/A N/A np cumsum se N/A se N/A N/A np sqrt se N/A se sp N/A N/A sp se time n d N/A SurvfuncRight N/A object N/A N/A 
    Estimation and inference for a survival function.

    Only right censoring is supported.

    Parameters
    ----------
    time : array-like
        An array of times (censoring times or event times)
    status : array-like
        Status at the event time, status==1 is the 'event'
        (e.g. death, failure), meaning that the event
        occurs at the given value in `time`; status==0
        indicates that censoring has occured, meaning that
        the event occurs after the given value in `time`.
    title : string
        Optional title used for plots and summary output.

    Attributes
    ----------
    surv_prob : array-like
        The estimated value of the survivor function at each time
        point in `surv_times`.
    surv_prob_se : array-like
        The standard errors for the values in `surv_prob`.
    surv_times : array-like
        The points where the survival function changes.
    n_risk : array-like
        The number of subjects at risk just before each time value in
        `surv_times`.
    n_events : array-like
        The number of events (e.g. deaths) that occur at each point
        in `surv_times`.
     __init__ N/A N/A self time status title N/A None N/A N/A N/A self time N/A N/A np asarray time N/A N/A self status N/A N/A np asarray status N/A m N/A len status N/A x N/A _calc_survfunc_right time status N/A N/A self surv_prob N/A x N/A 0 N/A N/A self surv_prob_se N/A x N/A 1 N/A N/A self surv_times N/A x N/A 2 N/A N/A self n_risk N/A x N/A 3 N/A N/A self n_events N/A x N/A 4 N/A N/A self title N/A N/A title title N/A plot N/A N/A self ax N/A None N/A N/A 
        Plot the survival function.

        Examples
        --------
        Change the line color:

        >>> fig = sf.plot()
        >>> ax = fig.get_axes()[0]
        >>> li = ax.get_lines()
        >>> li[0].set_color('purple')
        >>> li[1].set_color('purple')

        Don't show the censoring points:

        >>> fig = sf.plot()
        >>> ax = fig.get_axes()[0]
        >>> li = ax.get_lines()
        >>> li[1].set_visible(False)
         N/A N/A plot_survfunc self ax N/A quantile N/A N/A self p N/A N/A N/A 
        Estimated quantile of a survival distribution.

        Parameters
        ----------
        p : float
            The probability point at which the quantile
            is determined.

        Returns the estimated quantile.
         N/A ii N/A N/A np flatnonzero N/A N/A self surv_prob N/A 1 p N/A N/A N/A len ii 0 N/A N/A N/A np nan N/A N/A N/A self surv_times N/A N/A ii N/A 0 N/A quantile_ci N/A N/A self p alpha method N/A 0.05 cloglog N/A N/A 
        Returns a confidence interval for a survival quantile.

        Parameters
        ----------
        p : float
            The probability point for which a confidence interval is
            determined.
        alpha : float
            The confidence interval has nominal coverage probability
            1 - `alpha`.
        method : string
            Function to use for g-transformation, must be ...

        Returns
        -------
        lb : float
            The lower confidence limit.
        ub : float
            The upper confidence limit.

        Notes
        -----
        The confidence interval is obtained by inverting Z-tests.  The
        limits of the confidence interval will always be observed
        event times.

        References
        ----------
        The method is based on the approach used in SAS, documented here:

          http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_lifetest_details03.htm
         N/A tr N/A N/A norm ppf N/A 1 N/A alpha 2 N/A method N/A N/A method lower N/A N/A method cloglog N/A N/A g N/A N/A N/A x N/A N/A N/A np log N/A N/A N/A np log x N/A gprime N/A N/A N/A x N/A N/A -1 N/A x N/A N/A np log x N/A N/A N/A method linear N/A N/A g N/A N/A N/A x N/A x N/A gprime N/A N/A N/A x N/A 1 N/A N/A N/A method log N/A N/A g N/A N/A N/A x N/A N/A N/A np log x N/A gprime N/A N/A N/A x N/A N/A 1 x N/A N/A N/A method logit N/A N/A g N/A N/A N/A x N/A N/A N/A np log N/A x N/A 1 x N/A gprime N/A N/A N/A x N/A N/A 1 N/A x N/A 1 x N/A N/A N/A method asinsqrt N/A N/A g N/A N/A N/A x N/A N/A N/A np arcsin N/A N/A np sqrt x N/A gprime N/A N/A N/A x N/A N/A 1 N/A N/A 2 N/A N/A np sqrt x N/A N/A np sqrt N/A 1 x N/A N/A N/A ValueError unknown method N/A r N/A N/A g N/A self surv_prob N/A g N/A 1 p N/A r N/A N/A gprime N/A self surv_prob N/A self surv_prob_se N/A ii N/A N/A np flatnonzero N/A N/A N/A np abs r tr N/A N/A N/A len ii 0 N/A N/A N/A N/A np nan N/A np nan N/A lb N/A N/A self surv_times N/A N/A ii N/A 0 N/A N/A N/A ii N/A -1 N/A N/A len N/A self surv_times 1 N/A N/A ub N/A np inf N/A N/A ub N/A N/A self surv_times N/A N/A N/A ii N/A -1 1 N/A N/A lb ub N/A summary N/A N/A self N/A N/A N/A 
        Return a summary of the estimated survival function.

        The summary is a datafram containing the unique event times,
        estimated survival function values, and related quantities.
         N/A df N/A N/A pd DataFrame index N/A self surv_times N/A N/A N/A df index name Time N/A N/A df N/A Surv prob N/A self surv_prob N/A N/A df N/A Surv prob SE N/A self surv_prob_se N/A N/A df N/A num at risk N/A self n_risk N/A N/A df N/A num events N/A self n_events N/A df N/A simultaneous_cb N/A N/A self alpha method transform N/A 0.05 hw log N/A N/A 
        Returns a simultaneous confidence band for the survival function.

        Arguments
        ---------
        alpha : float
            `1 - alpha` is the desired simultaneous coverage
            probability for the confidence region.  Currently alpha
            must be set to 0.05, giving 95% simultaneous intervals.
        method : string
            The method used to produce the simultaneous confidence
            band.  Only the Hall-Wellner (hw) method is currently
            implemented.
        transform : string
            The used to produce the interval (note that the returned
            interval is on the survival probability scale regardless
            of which transform is used).  Only `log` and `arcsin` are
            implemented.

        Returns
        -------
        lcb : array-like
            The lower confidence limits corresponding to the points
            in `surv_times`.
        ucb : array-like
            The upper confidence limits corresponding to the points
            in `surv_times`.
         N/A method N/A N/A method lower N/A N/A method hw N/A N/A N/A ValueError only the Hall-Wellner (hw) method is implemented N/A N/A alpha 0.05 N/A N/A N/A ValueError alpha must be set to 0.05 N/A transform N/A N/A transform lower N/A s2 N/A N/A N/A self surv_prob_se 2 N/A N/A self surv_prob 2 N/A nn N/A self n_risk N/A N/A transform log N/A N/A denom N/A N/A N/A np sqrt nn N/A N/A np log N/A self surv_prob N/A theta N/A N/A 1.3581 N/A 1 N/A nn s2 denom N/A theta N/A N/A np exp theta N/A lcb N/A N/A self surv_prob N/A 1 theta N/A ucb N/A N/A self surv_prob theta N/A N/A N/A transform arcsin N/A N/A k 1.3581 N/A k N/A N/A 1 N/A nn s2 N/A 2 N/A N/A np sqrt nn N/A k N/A N/A np sqrt N/A N/A self surv_prob N/A 1 N/A self surv_prob N/A f N/A N/A np arcsin N/A N/A np sqrt N/A self surv_prob N/A v N/A N/A np clip N/A f k 0 N/A np inf N/A lcb N/A N/A N/A np sin v 2 N/A v N/A N/A np clip N/A f k N/A N/A np inf N/A N/A np pi 2 N/A ucb N/A N/A N/A np sin v 2 N/A N/A N/A ValueError Unknown transform N/A N/A lcb ucb N/A N/A survdiff N/A N/A time status group weight_type strata N/A None None kwargs N/A N/A 
    Test for the equality of two survival distributions.

    Parameters:
    -----------
    time : array-like
        The event or censoring times.
    status : array-like
        The censoring status variable, status=1 indicates that the
        event occured, status=0 indicates that the observation was
        censored.
    group : array-like
        Indicators of the two groups
    weight_type : string
        The following weight types are implemented:
            None (default) : logrank test
            fh : Fleming-Harrington, weights by S^(fh_p),
                 requires exponent fh_p to be provided as keyword
                 argument; the weights are derived from S defined at
                 the previous event time, and the first weight is
                 always 1.
            gb : Gehan-Breslow, weights by the number at risk
            tw : Tarone-Ware, weights by the square root of the number
                 at risk
    strata : array-like
        Optional stratum indicators for a stratified test

    Returns:
    --------
    chisq : The chi-square (1 degree of freedom) distributed test
            statistic value
    pvalue : The p-value for the chi^2 test
     N/A time N/A N/A np asarray time N/A status N/A N/A np asarray status N/A group N/A N/A np asarray group N/A gr N/A N/A np unique group N/A N/A N/A len gr 2 N/A N/A N/A ValueError logrank only supports two groups N/A N/A strata None N/A N/A N/A obs var N/A _survdiff time status group weight_type gr kwargs N/A N/A strata N/A N/A np asarray strata N/A stu N/A N/A np unique strata N/A N/A obs var N/A 0.0 0.0 N/A st stu N/A N/A ii N/A strata st N/A N/A obs1 var1 N/A _survdiff N/A time N/A ii N/A status N/A ii N/A group N/A ii weight_type gr kwargs N/A obs obs1 N/A var var1 N/A zstat N/A obs N/A N/A np sqrt var N/A chisq N/A zstat 2 N/A pvalue N/A 1 N/A N/A chi2 cdf chisq 1 N/A N/A chisq pvalue N/A _survdiff N/A N/A time status group weight_type gr N/A kwargs N/A N/A ii N/A group N/A gr N/A 0 N/A time1 N/A time N/A ii N/A status1 N/A status N/A ii N/A ii N/A group N/A gr N/A 1 N/A time2 N/A time N/A ii N/A status2 N/A status N/A ii N/A utimes N/A N/A np unique time N/A status1 N/A N/A status1 astype N/A np bool N/A status2 N/A N/A status2 astype N/A np bool N/A ix1 N/A N/A np searchsorted utimes N/A time1 N/A status1 N/A ix2 N/A N/A np searchsorted utimes N/A time2 N/A status2 N/A obs1 N/A N/A np bincount ix1 minlength N/A len utimes N/A obs2 N/A N/A np bincount ix2 minlength N/A len utimes N/A obs N/A obs1 obs2 N/A nvec N/A N/A time0 N/A time1 time2 N/A N/A ix N/A N/A np searchsorted utimes time0 N/A n N/A N/A np bincount ix minlength N/A len utimes N/A n N/A N/A np cumsum n N/A n N/A N/A np roll n 1 N/A N/A n N/A 0 0 N/A n N/A N/A len time0 n N/A N/A N/A nvec append n N/A N/A n1 n2 N/A tuple nvec N/A n N/A n1 n2 N/A r N/A n1 N/A N/A n astype N/A np float64 N/A var N/A N/A N/A N/A obs r N/A 1 r N/A n obs N/A n 1 N/A exp1 N/A obs r N/A weights None N/A N/A weight_type None N/A N/A weight_type N/A N/A weight_type lower N/A N/A weight_type gb N/A N/A weights n N/A N/A N/A weight_type tw N/A N/A weights N/A N/A np sqrt n N/A N/A N/A weight_type fh N/A N/A N/A fh_p kwargs N/A N/A N/A ValueError weight_type type 'fh' requires specification of fh_p N/A fh_p N/A kwargs N/A fh_p N/A sp N/A 1 N/A obs N/A N/A n astype N/A np float64 N/A sp N/A N/A np log sp N/A sp N/A N/A np cumsum sp N/A sp N/A N/A np exp sp N/A weights N/A sp fh_p N/A weights N/A N/A np roll weights 1 N/A N/A weights N/A 0 1 N/A N/A N/A ValueError weight_type not implemented N/A ix N/A N/A np flatnonzero N/A n 1 N/A N/A weights None N/A N/A obs N/A N/A np sum N/A N/A obs1 N/A ix N/A exp1 N/A ix N/A var N/A N/A np sum N/A var N/A ix N/A N/A obs N/A N/A np dot N/A weights N/A ix N/A N/A obs1 N/A ix N/A exp1 N/A ix N/A var N/A N/A np dot N/A N/A weights N/A ix 2 N/A var N/A ix N/A N/A obs var N/A plot_survfunc N/A N/A survfuncs ax N/A None N/A N/A 
    Plot one or more survivor functions.

    Arguments
    ---------
    survfuncs : object or array-like
        A single SurvfuncRight object, or a list or SurvfuncRight
        objects that are plotted together.

    Returns
    -------
    A figure instance on which the plot was drawn.

    Examples
    --------
    Add a legend:

    >>> fig = plot_survfunc([sf0, sf1])
    >>> ax = fig.get_axes()[0]
    >>> ax.set_position([0.1, 0.1, 0.64, 0.8])
    >>> ha, lb = ax.get_legend_handles_labels()
    >>> leg = fig.legend((ha[0], ha[2]), (lb[0], lb[2]), 'center right')

    Change the line colors:

    >>> fig = plot_survfunc([sf0, sf1])
    >>> ax = fig.get_axes()[0]
    >>> ax.set_position([0.1, 0.1, 0.64, 0.8])
    >>> ha, lb = ax.get_legend_handles_labels()
    >>> ha[0].set_color('purple')
    >>> ha[1].set_color('purple')
    >>> ha[2].set_color('orange')
    >>> ha[3].set_color('orange')
     N/A N/A fig ax N/A N/A utils create_mpl_ax ax N/A N/A N/A N/A N/A type N/A survfuncs N/A 0 SurvfuncRight N/A N/A N/A N/A survfuncs N/A survfuncs N/A N/A gx sf N/A enumerate survfuncs N/A N/A surv_times N/A N/A np concatenate N/A N/A 0 N/A sf surv_times N/A surv_prob N/A N/A np concatenate N/A N/A 1 N/A sf surv_prob N/A mxt N/A max N/A sf time N/A N/A mxt N/A surv_times N/A -1 N/A N/A surv_times N/A N/A np concatenate N/A surv_times N/A mxt N/A surv_prob N/A N/A np concatenate N/A surv_prob N/A N/A surv_prob N/A -1 N/A label N/A getattr sf title N/A Group %d N/A gx 1 N/A N/A li N/A N/A ax step surv_times surv_prob - label label lw 2 where post N/A ii N/A N/A np flatnonzero N/A N/A np logical_not N/A sf status N/A ti N/A N/A sf time N/A ii N/A jj N/A N/A N/A np searchsorted surv_times ti 1 N/A sp N/A surv_prob N/A jj N/A N/A N/A ax plot ti sp + ms 12 color N/A N/A li get_color label N/A label  points N/A N/A N/A ax set_ylim 0 1.01 N/A fig N/A