| ocmath_surviv_fn_comp  DescriptionSurvival Analysis function used to compute the statistics of survival function comparison. This is an OriginPro only function. Syntax
int ocmath_surviv_fn_comp( const double * pTime, uint nTime, const double * pCensor, uint nCensor, const double * pFactor, uint nFactor, const double * pCensored, uint nCensoredVal, SFComp * psSFComp, int nMethod = 0 )
 Parameters
    pTime[Input] pointer to time valuesnTime]Input] size of time values.pCensor[Input] pointer to censor valuesnCensor[Input] size of censor valuespFactor[Input] pointer to Factor value to indicates which group the observation belongs to.nFactor[Input] size of factor valuespCensored[Input] pointer to Censored value. Please make sure that value of pCensored are all in pCensor and value are unduplicated.nCensoredValInput size of censored values, which needs to be less than 20psSFComp[Ouput] pointer to structure containing test statistics of survival functions comparisonnMethod[Input] flag to indicats method used in the compasitonSA_SFCOMP_LOGRANK: Log rankSA_SFCOMP_BRESLOW: BreslowSA_SFCOMP_TARONEWARE: Tarone-Ware ReturnReturns STATS_NO_ERROR on successful exit or an STATS error code on failure. ExamplesEX1 
void ocmath_surviv_fn_comp_example()
{
    vector vTime = {6,6,8,9,19,5,9,9,10};
    vector vCensor = {1,0,1,0,1,1,1,0,0};
    vector vFactor = {1,1,1,1,1,2,2,2,2};
    vector vCensored(1) = {0};
    SFComp stSFComp;
    int nMethod = 0;
    int    nRet = ocmath_surviv_fn_comp(vTime, vTime.GetSize(), 
                    vCensor, vCensor.GetSize(), vFactor, vFactor.GetSize(), vCensored, 
                    vCensored.GetSize(), &stSFComp, nMethod);
    //Result:                
    //stSFComp.ChiSq = 0.006681019073873;
    //stSDComp.DOF = 1;
    //stSDComp.Prob = 0.9348554566125;    
}
RemarkSee Alsoheader to Includeorigin.h Reference |