statgraphics.survival
Class SurvivalEstimatePlot

java.lang.Object
  extended by statgraphics.survival.SurvivalEstimatePlot

public class SurvivalEstimatePlot
extends java.lang.Object

Constructs a survival estimate plot.


Example:

double [] sortedTime={{59,115,156,268,329,353,365,431,464,475,563,638,700},
                                          {76,105,144,201,254,315,447,527,655}};
double [] sortedSurvivalEstimate={{0.9615,0.9231,0.8846,0.8462,0.8077,0.7692,
                                                               0.7308,0.6878,0.6419,0.5961,0.5464,0.4967,0.4967},
                                                              {0.8812,0.8234,0.7689,0.6612,0.5644,0.5034,0.3416,0.3001,0.2219}};
String[] names=new String[]{"Control","Treatment"};
SurvivalEstimatePlot survivalEstimatePlot = new SurvivalEstimatePlot( sortedTime,sortedSurvivalEstimate,names);
PlotFrame pf=new PlotFrame("Kaplan-Meier Estimate Plot", survivalEstimatePlot.getPlot(),500,270);

new PlotFrameFactory().putPlotFrame(pf);


Field Summary
 org.jfree.chart.JFreeChart plot
          The Kaplan-Meier estiamte plot.
 double[][] sortedSurvivalEstimate
          The survival estimates in descending order.
 double[][] sortedTime
          The survival times in ascending order.
 java.lang.String title
          The plot title.
 java.lang.String xLabel
          The label for the x-coordinate.
 java.lang.String yLabel
          The label for the y-coordinate.
 
Constructor Summary
SurvivalEstimatePlot(double[][] sortedTime, double[][] sortedSurvivalEstimate, java.lang.String[] dataNames)
          Creates a new survival estimate plot with the specified names of the series.
SurvivalEstimatePlot(double[][] sortedTime, double[][] sortedSurvivalEstimate, java.lang.String[] dataNames, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel)
          Creates a new survival estimate plot with the specified names of the series, title and labels for the x-coordinate and y-coordinate.
SurvivalEstimatePlot(double[] sortedTime, double[] sortedSurvivalEstimate)
          Creates a new survival estimate plot.
SurvivalEstimatePlot(double[] sortedTime, double[] sortedSurvivalEstimate, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel)
          Creates a new survival estimate plot with the specified title and labels for the x-coordinate and y-coordinate.
 
Method Summary
 org.jfree.chart.JFreeChart getPlot()
          Returns the created survival estimate plot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plot

public org.jfree.chart.JFreeChart plot
The Kaplan-Meier estiamte plot.


sortedTime

public double[][] sortedTime
The survival times in ascending order.


sortedSurvivalEstimate

public double[][] sortedSurvivalEstimate
The survival estimates in descending order.


title

public java.lang.String title
The plot title.


xLabel

public java.lang.String xLabel
The label for the x-coordinate.


yLabel

public java.lang.String yLabel
The label for the y-coordinate.

Constructor Detail

SurvivalEstimatePlot

public SurvivalEstimatePlot(double[][] sortedTime,
                            double[][] sortedSurvivalEstimate,
                            java.lang.String[] dataNames,
                            java.lang.String title,
                            java.lang.String xLabel,
                            java.lang.String yLabel)
Creates a new survival estimate plot with the specified names of the series, title and labels for the x-coordinate and y-coordinate.

Parameters:
sortedTime - the series of survival times in ascending order. sortedTime[j]: the (j+1)'th series of survival times.
sortedSurvivalEstimate - the series of survival estimates in descending order. sortedSurvivalEstimate[j]: the (j+1)'th series of survival estimates.
dataNames - the names of these series. dataNames[j]: the name of the (j+1)'th series.
title - the plot title.
xLabel - the label for the x-coordinate.
yLabel - the label for the y-coordinate.
Throws:
IllegalArgumentExceptio - the sortedTime vector and sortedSurvivalEstimate vector must have the same length.

SurvivalEstimatePlot

public SurvivalEstimatePlot(double[] sortedTime,
                            double[] sortedSurvivalEstimate,
                            java.lang.String title,
                            java.lang.String xLabel,
                            java.lang.String yLabel)
Creates a new survival estimate plot with the specified title and labels for the x-coordinate and y-coordinate.

Parameters:
sortedTime - the survival times in ascending order.
sortedSurvivalEstimate - the survival estimates in descending order.
title - the plot title.
xLabel - the label for the x-coordinate.
yLabel - the label for the y-coordinate.
Throws:
IllegalArgumentExceptio - the sortedTime vector and sortedSurvivalEstimate vector must have the same length.

SurvivalEstimatePlot

public SurvivalEstimatePlot(double[][] sortedTime,
                            double[][] sortedSurvivalEstimate,
                            java.lang.String[] dataNames)
Creates a new survival estimate plot with the specified names of the series.

Parameters:
sortedTime - the series of survival times in ascending order. sortedTime[j]: the (j+1)'th series of survival times.
sortedSurvivalEstimate - the series of survival estimates in descending order. sortedSurvivalEstimate[j]: the (j+1)'th series of survival estimates.
dataNames - the names of these series. dataNames[j]: the name of the (j+1)'th series.
Throws:
IllegalArgumentExceptio - the sortedTime vector and sortedSurvivalEstimate vector must have the same length.

SurvivalEstimatePlot

public SurvivalEstimatePlot(double[] sortedTime,
                            double[] sortedSurvivalEstimate)
Creates a new survival estimate plot.

Parameters:
sortedTime - the survival times in ascending order.
sortedSurvivalEstimate - the survival estimates in descending order.
Throws:
IllegalArgumentExceptio - the sortedTime vector and sortedSurvivalEstimate vector must have the same length.
Method Detail

getPlot

public org.jfree.chart.JFreeChart getPlot()
Returns the created survival estimate plot.

Returns:
the survival estimate plot.