| ocmath_surviv_weibull_simple  DescriptionSurvival Analysis function used to compute the parameter estimates and other statistics that are associated with the Weibull model without covariates. The main engine is nag_estim_weibull. Syntax
int ocmath_surviv_weibull_simple( const double * pTime, uint nTime, const double * pCensor, uint nCensor, const double * pCensored, uint nCensoredVal, const double dConfLevel, double * pCriterion, SASummary * psSASummary, SAParaEstim * psSAParaEstim, uint nSizeParaEstim )
 Parameters
    pTime[input] pointer to time valuesnTime[input] size of time values.pCensor[input] pointer to censor valuesnCensor[input] size of censor valuespCensored[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 20dConfLevel[input] confidence level of LCI and UCL of parameter estimatepCriterion[Output] pointer to the maximum log-likelihood.psSASummary[output] pointer to structure containing summary of event and censored values.psSAParaEstim[output] pointer to structure containing parameter estimates.nSizeParaEstim[input] Number of structure psSAParaEstim, should always be 4. ReturnReturns STATS_NO_ERROR on successful exit or an STATS error code on failure. ExamplesEX1 
#include <ocStats.h>
void weibull_test()
{    
    vector vTime={1.1,1.4,1.3,1.7,1.9,1.8,1.6,2.2,1.7,2.7,4.1,1.8,1.5,1.2,1.4,3,1.7,2.3,1.6,2};
    vector vCensor={5,0,1,0,0,3,4,0,0,2,0,0,0,0,0,0,0,0,0,0};
    vector vCensored={1,2,3,4};
    
    int nTime=vTime.GetSize();
    int nCensor=vCensor.GetSize();
    int nCensored=vCensored.GetSize();
    SASummary psSASummary;    
    SAParaEstim psSAParaEstim[4];
    double dConfLevel=0.95;    
    double dCriterion;
    int nSizeParaEstim=4;
      
    ocmath_surviv_weibull_simple(vTime,
                                 nTime,
                                 vCensor,
                                 nCensor, 
                                 vCensored, 
                                 nCensored, 
                                 dConfLevel,
                                 &dCriterion,
                                 &psSASummary,
                                 psSAParaEstim,
                                 nSizeParaEstim);
}
RemarkSee Alsoheader to Includeorigin.h Reference |