Statistics: Survival Analysis: Kaplan-Meier Estimator
Perform a Kaplan-Meier (product-limit) analysis
This feature is for OriginPro only.
1. kaplanmeier irng:=(1,2) censor:=0 2. kaplanmeier irng:=(1,2,3) censor:=0 hazard:=1
Please refer to the page for additional option switches when accessing the x-function from script
Input
Range
Specify data range for analysis, including time data range, censor data range and grouping range.
Time data range
Specify time data column
Censor data range
Specify censor data column
Grouping range
Specify group data range.
vector
Specify the censor subject value, that identifies which time values in the observation data set are censored
int
Check box for output the summary of event and censored value result.
Check box for output the survival estimates result.
Check box for output the quantile estimates result.
Check box for the mean estimates result.
double
Text box to enter a confidence level to be used when computing errors for the survival function and upper and lower limits of the quartile estimates.
Check box for output survival curve.
Add confidence intervals to the survival curve.
Check box for output of one minus survival curve, i.e. the cumulative distribution curve.
Check box for output of the hazard curve.
Check box for output of the log survival curve.
Check to mark censored points.
Check to plot all the survival curves in one graph window
Use the Log rank method to test the equality of the survival distributions for different groups.
Use the Breslow method to test the equality of the survival distributions for different groups.
Use the Tarone-Ware method to test the equality of the survival distributions for different groups.
When any of the equality tests is chosen you can enable pairwise comparisons for comparing 3 or more groups.
Output
ReportData
Specify the survival function data destination
ReportTree
Specify the report worksheet destination
/* This example is used to show how to use product-limit method to estimate the survival rate. The sample data used is in OriginPath\Samples\Statistics folder. 1. Import the sample data into a book in Origin 2. use kaplanmeier XF to calculate the values of survival function. 3. put the result into a new sheet 4. Plot the survival function into a new graph. */ /*Import the sample data into a new book*/ String fname$=system.path.program$+"Samples\Statistics\Kaplan-Meier.dat"; newbook; impASC; string bkn$=%H; /*Use kaplanmeier XF to calculate the values of survival function*/ kaplanmeier irng:=[bkn$]1!(col(1),col(2)) censor:=0 quartile:=1 mean:=1 rt:=<new name:="KaplanMeier">; /*Plot the survival function in a new graph named "Survival Function Plot"*/ plotxy iy:=[bkn$]2!(col(1),col(2)) plot:=202 ogl:=<new name:="Survival Function Plot">; /*New a sheet to store the results of the Kaplan-Meier estimator*/ newsheet book:=bkn$ name:="Result" label:="Parameter|Estimate|95% CI_Lower|95% CI_Upper"; wcolwidth [bkn$]"Result"!1 12; range Para=[bkn$]Result!col(1); range Est=[bkn$]Result!col(2); range Lower=[bkn$]Result!col(3); range Upper=[bkn$]Result!col(4); getresults iw:=[bkn$]3 tr:=mytree; Para[1]$="25% of survival time"; Para[2]$="50% of survival time"; Para[3]$="75% of survival time"; Para[4]$="mean of survival time"; Est[1]=mytree.sa.quan.Quan1.Estim; Est[2]=mytree.sa.quan.Quan2.Estim; Est[3]=mytree.sa.quan.Quan3.Estim; Est[4]=mytree.sa.mean.Mean.Estim; Lower[1]=mytree.sa.quan.Quan1.LCI; Lower[2]=mytree.sa.quan.Quan2.LCI; Lower[3]=mytree.sa.quan.Quan3.LCI; Lower[4]=mytree.sa.mean.Mean.LCI; Upper[1]=mytree.sa.quan.Quan1.UCI; Upper[2]=mytree.sa.quan.Quan2.UCI; Upper[3]=mytree.sa.quan.Quan3.UCI; Upper[4]=mytree.sa.mean.Mean.UCI;
For more information, please refer to our User Guide.
phm_Cox, weibullfit