ocmath_kaplan_meier_surviv_fn

 

Description

Survival Analysis function used to compute the Kaplan-Meier Estimate of survival probalities for a sample of failure times. This is an OriginPro only function.

Syntax

int ocmath_kaplan_meier_surviv_fn( const double * pTime, uint nTime, const double * pCensor, uint nCensor, const double * pCensored, uint nCensoredVal, const double dConLevel, SAEstim * psSurvivEstim, uint nSizeSAEstm, SAQuantEst * psSAQuantEstim, uint nSizeQuanEstm, SASummary * stSASumStats, SAMeanEst * pSAMeanEst = NULL )

Parameters

pTime
[input] pointer to time values
nTime
[input] size of time values.
pCensor
[input] pointer to censor values
nCensor
[input] size of censor values
pCensored
[input] pointer to Censored value. Please make sure that value of pCensored are all in pCensor and value are unduplicated.
nCensoredVal
[input] size of censored values, which needs to be less than 20
dConLevel
[input] confidence level
psSurvivEstim
[output] structure containing the Survival Analysis of time
nSizeSAEstm
[input] size (number of structure) of psSurvivEstim. it should not be less than size of vTime
psSAQuantEstim
[output] structure containing Quartile estimates
nSizeQuanEstm
[input] size (number of structure) of psSAQuantEstim. It should not be less than 3.
stSASumStats
[output] pointer to structure containing summary of event and censored values
pSAMeanEst
[output] pointer to structure constaining mean estimates

Return

Returns STATS_NO_ERROR on successful exit or an STATS error code on failure.

Examples

EX1

void ocmath_kaplan_meier_surviv_fn_ex1()
{
    vector vTime = { 107,90,169,50,954,972,6,111,70,90,930,52,50,414,111,482,104,29,983,93,133,468,65,846 };
    vector pCensor = { 0,1,0,1,0,0,1,1,0,2,0,0,0,2,0,1,0,1,1,0,2,0,0,1 };
    vector pCensored = {0, 2};
    int nCensoredVal = pCensored.GetSize();
    double dConLevel = 0.90;
    
    SAEstim psSurvivEstim[24];
    SAQuantEst psSAQuantEstim[3];
    SASummary stSASumStats;
    SAMeanEst pSAMeanEst;

    int nRet = ocmath_kaplan_meier_surviv_fn(vTime, vTime.GetSize(), pCensor, pCensor.GetSize(), pCensored, nCensoredVal, dConLevel, psSurvivEstim, 24, psSAQuantEstim, 3, &stSASumStats);
}

Remark

See Also

header to Included

origin.h

Reference