2.1.24.9.2 ocmath_surviv_fn_comp
Description
Survival 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 values
- nTime
- ]Input] size of time values.
- pCensor
- [Input] pointer to censor values
- nCensor
- [Input] size of censor values
- pFactor
- [Input] pointer to Factor value to indicates which group the observation belongs to.
- nFactor
- [Input] size of factor 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
- psSFComp
- [Ouput] pointer to structure containing test statistics of survival functions comparison
- nMethod
- [Input] flag to indicats method used in the compasiton
- SA_SFCOMP_LOGRANK: Log rank
- SA_SFCOMP_BRESLOW: Breslow
- SA_SFCOMP_TARONEWARE: Tarone-Ware
Return
Returns STATS_NO_ERROR on successful exit or an STATS error code on failure.
Examples
EX1
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;
}
Remark
See Also
Header to Include
origin.h
Reference
|