Survival
Example 1
Summary: Performs survival analysis on the BrakeReliability data set by opening a data table, defining variables for time cycles, censoring, and grouping, and generating a survival plot.
Code:
// Survival
// Open data table
dt = Open("data_table.jmp");
// Survival
Survival(
Y( :days ),
Censor( :Censor ),
Grouping( :Group ),
Survival Plot( 1 )
);
Code Explanation:
- Open table.
- Define variable dt.
- Call Survival function.
- Specify Y variable.
- Specify Censor variable.
- Specify Group variable.
- Enable Survival Plot.
Example 2
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, opening a data table and running survival analysis.
Code:
// Survival
// Open data table
dt = Open("data_table.jmp");
// Survival
Survival(
Y( :Time Cycles ),
Censor( :Censor ),
Grouping( :Group )
);
Code Explanation:
- Open data table.
- Run survival analysis.
Example 3
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, visualizing results in a customized survival plot with years on the X-axis and normal probability on the Y-axis.
Code:
dt = Open("data_table.jmp");
Survival(
Y( :days ),
Censor( :Censor ),
Grouping( :Group ),
Failure Plot( 0 ),
Show Points( 1 ),
Show Confid Interval( 1 ),
Exponential Plot( 1 ),
Weibull Plot( 1 ),
LogNormal Plot( 1 ),
Exponential Fit( 1 ),
Weibull Fit( 1 ),
Fitted Quantile( 1 ),
SendToReport(
Dispatch( {}, "Survival Plot", OutlineBox, {Set Title( "Survival Plot - custom format shows \!"yrs\!"" )} ),
Dispatch( {"Survival Plot"}, "1", ScaleBox,
{Scale( "Power" ), Format( "Custom", Formula( Char( Round( value / 365.25, 2 ) ) || " yrs" ), 12 ), Minor Ticks( 1 )}
),
Dispatch( {"Survival Plot"}, "2", ScaleBox,
{Scale( "Normal Probability" ), Format( "Custom", Formula( Round( value, 4 ) ), 12 ), Min( 0.0000000000000002 ), Max( 1 ),
Inc( 1 ), Minor Ticks( 1 ), Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "Exponential Plot", OutlineBox, {Set Title( "Exponential Plot - custom format shows \!"yrs\!" on X and Pi on Y" )} ),
Dispatch( {"Exponential Plot"}, "1", ScaleBox,
{Scale( "Power" ), Format( "Custom", Formula( Char( Round( value / 365.25, 2 ) ) || " yrs" ), 12 ), Minor Ticks( 1 )}
),
Dispatch( {"Exponential Plot"}, "2", ScaleBox, {Format( "Custom", Formula( Round( Pi(), 4 ) ), 9 )} ),
Dispatch( {}, "LogNormal Plot", OutlineBox, {Set Title( "LogNormal Plot - custom format should show all Zeroes on y axis" )} ),
Dispatch( {"Weibull Plot"}, "2", ScaleBox, {Format( "Custom", Formula( Round( e(), 5 ) ), 9 )} ),
Dispatch( {"LogNormal Plot"}, "2", ScaleBox, {Format( "Custom", Formula( 0 ), 9 )} )
)
);
Code Explanation:
- Open data table.
- Define survival analysis.
- Set Y variable.
- Set censor variable.
- Set grouping variable.
- Disable failure plot.
- Enable point display.
- Enable confidence interval.
- Enable exponential plot.
- Enable Weibull plot.
- Enable log-normal plot.
- Enable exponential fit.
- Enable Weibull fit.
- Enable fitted quantile.
- Customize survival plot title.
- Customize X-axis scale to years.
- Customize Y-axis scale to normal probability.
- Customize exponential plot title.
- Customize exponential X-axis to years.
- Customize exponential Y-axis to Pi.
- Customize log-normal plot title.
- Customize Weibull Y-axis to e.
- Customize log-normal Y-axis to zero.
Example 4
Summary: Runs survival analysis and visualization for reliability growth analysis using the Piecewise Weibull NHPP model on the BrakeReliability data set, including failure plots, exponential plots, Weibull plots, log-normal plots, and fitted distribution plots.
Code:
Open("data_table.jmp");
Survival(
Y( :Time Cycles ),
Censor( :Censor ),
Grouping( :Group ),
Failure Plot( 1 ),
Exponential Plot( 1 ),
Weibull Plot( 1 ),
LogNormal Plot( 1 ),
Exponential Fit( 1 ),
Weibull Fit( 1 ),
LogNormal Fit( 1 ),
Fitted Quantile( 1 ),
Fitted Quantile CI Lines( 1 ),
Fitted Distribution Plots( 1 ),
SendToReport(
Dispatch( {}, "Survival Plot", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Failure Plot", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Exponential Plot", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Exponential Parameter Estimates", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Weibull Plot", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Extreme-Value Parameter Estimates", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Weibull Parameter Estimates", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "LogNormal Plot", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "LogNormal Parameter Estimates", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Tests Between Groups", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table.
- Perform survival analysis.
- Set time cycles as Y variable.
- Use censor data.
- Group by group variable.
- Create failure plot.
- Create exponential plot.
- Create Weibull plot.
- Create log-normal plot.
- Fit exponential model.
Example 5
Summary: Performs a survival analysis to model reliability growth using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, with censoring and competing causes.
Code:
dt = Open("data_table.jmp");
obj = dt << Survival( Y( :days ), Censor( :Censor ), Grouping( :Group ) );
obj << Competing Causes( :Failure Cause );
Code Explanation:
- Open data table;
- Create survival analysis object.
- Set response variable to "days".
- Define censoring variable as "Censor".
- Group by "Group" variable.
- Add competing causes analysis.
- Specify "Failure Cause" for competing causes.
Example 6
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set.
Code:
dt = Open("data_table.jmp");
obj = dt << Survival( Y( :days ), Censor( :Censor ), Grouping( :Group ) );
obj << Competing Causes( :Failure Cause );
Eval( obj << Get Script );
Code Explanation:
- Open data table.
- Perform survival analysis.
- Set response variable to "days".
- Define censoring variable as "Censor".
- Use "Group" for grouping.
- Specify competing causes using "Failure Cause".
- Retrieve and evaluate script from object.
Example 7
Summary: Performs a survival analysis on the BrakeReliability data set, generating failure plots, exponential plots, and exponential fits for change point detection.
Code:
dt under test = Open("data_table.jmp");
obj = Survival(
Y( :Time Cycles ),
Censor( :Censor ),
Grouping( :Group ),
Failure Plot( 1 ),
Survival Plot( 0 ),
Exponential Plot( 1 ),
Exponential Fit( 1 ),
Fitted Quantile( 1 ),
SendToReport(
Dispatch( {}, "Product-Limit Survival Fit", OutlineBox, {Set Title( "Failure Plot, Exponential Plot, Exponential Fit" )} ),
Dispatch( {}, "Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Tests Between Groups", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table;
- Run Survival analysis.
- Set Time Cycles as response.
- Set Censor as censor variable.
- Use Group for grouping.
- Enable Failure Plot.
- Disable Survival Plot.
- Enable Exponential Plot.
- Enable Exponential Fit.
- Enable Fitted Quantile plot.
Example 8
Summary: Runs a reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, enabling visualization of Weibull and LogNormal plots, fitting of both models, and quantile plotting.
Code:
dt under test = Open("data_table.jmp");
obj = Survival(
Y( :Time Cycles ),
Censor( :Censor ),
Grouping( :Group ),
Failure Plot( 0 ),
Survival Plot( 0 ),
Weibull Plot( 1 ),
LogNormal Plot( 1 ),
Weibull Fit( 1 ),
LogNormal Fit( 1 ),
Fitted Quantile( 1 ),
SendToReport(
Dispatch( {}, "Product-Limit Survival Fit", OutlineBox, {Set Title( "Weibull Plot, Weibull Fit, LogNormal Plot, LogNormal Fit" )} ),
Dispatch( {}, "Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Tests Between Groups", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open table.
- Define survival analysis object.
- Set response variable.
- Set censor variable.
- Set grouping variable.
- Disable failure plot.
- Disable survival plot.
- Enable Weibull plot.
- Enable LogNormal plot.
- Enable Weibull fit.
- Enable LogNormal fit.
- Enable fitted quantile plot.
- Set report title.
- Close summary section.
- Close quantiles section.
- Close tests between groups section.
Example 9
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set.
Code:
dt under test = Open("data_table.jmp");
obj = Survival( Y( :Time Cycles ), Censor( :Censor ), Grouping( :Group ) );
Code Explanation:
- Open data table.
- Assign table to variable.
- Create survival analysis object.
- Specify response variable.
- Define censoring variable.
- Set grouping variable.
Example 10
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, with interactive filtering and selection capabilities.
Code:
dt = Open("data_table.jmp");
obj = Survival( Y( :height ), Failure Plot( 0 ), );
obj << Local Data Filter(
Location( {1106, 48} ),
Add Filter( columns( :sex ), Where( :sex == "F" ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
obj << Automatic Recalc( 0 );
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open data table.
- Create survival object.
- Set local data filter location.
- Add filter for female sex.
- Configure filter mode.
- Disable automatic recalculation.
- Select rows where age is 12.
- Exclude selected rows.
- Generate report from survival object.
Example 11
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, filtering females and selecting rows where age is 12.
Code:
dt = Open("data_table.jmp");
obj = Survival( Y( :height ), Failure Plot( 0 ), );
obj << Local Data Filter(
Location( {1106, 48} ),
Add Filter( columns( :sex ), Where( :sex == "F" ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Close( dt, NoSave );
dt = Open("data_table.jmp");
obj = Survival( Y( :height ), Failure Plot( 0 ), );
obj << Local Data Filter(
Location( {1106, 48} ),
Add Filter( columns( :sex ), Where( :sex == "F" ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
obj << Automatic Recalc( 0 );
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open data table;
- Create survival analysis object.
- Add local data filter for females.
- Select rows where age is 12.
- Exclude selected rows.
- Generate report from analysis.
- Close table without saving.
- Reopen "data_table.jmp" table.
- Recreate survival analysis object.
- Add local data filter for females.
Example 12
Summary: Performs a survival analysis to model reliability growth using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set.
Code:
dt = Open("data_table.jmp");
obj = dt << Survival( Y( :days ), Censor( :Censor ), Grouping( :Group ) );
obj << Weibull Fit( 1 );
mytab = obj << Save Estimates;
Code Explanation:
- Open data_table data
- Create survival analysis object.
- Set response variable to "days".
- Define censoring variable as "Censor".
- Specify grouping variable as "Group".
- Perform Weibull fit analysis.
- Save parameter estimates.
Example 13
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, generating a report with fitted quantile and confidence intervals.
Code:
dt = Open("data_table.jmp");
obj = Survival(
Y( :days ),
Censor( :Censor ),
Grouping( :Group ),
Failure Plot( 0 ),
Show Points( 1 ),
Show Confid Interval( 1 ),
Exponential Plot( 1 ),
Weibull Plot( 1 ),
LogNormal Plot( 1 ),
Exponential Fit( 1 ),
Weibull Fit( 1 ),
Fitted Quantile( 1 )
);
:Days << Set Property( "Missing Value Codes", {999} );
:Days << Set Values( {999, 999, 999} );
obj2 = obj << Redo Analysis;
rpt = obj2 << Report;
actN = (rpt[Number Col Box( 45 )][1]);
Code Explanation:
- Open data table;
- Create survival analysis object.
- Set Y variable to "days".
- Set Censor variable to "Censor".
- Set Grouping variable to "Group".
- Disable Failure Plot.
- Enable Show Points.
- Enable Show Confid Interval.
- Enable Exponential Plot.
- Enable Weibull Plot.
- Enable LogNormal Plot.
- Enable Exponential Fit.
- Enable Weibull Fit.
- Enable Fitted Quantile.
- Set missing value code for "Days" to 999.
- Set "Days" values to 999.
- Redo the survival analysis.
- Generate report from analysis.
- Extract value from report box 45.
Example 14
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, extracting mean values, standard error values, and chi-square values.
Code:
dt = Open("data_table.jmp");
SASMean = [218.75657895, 240.79464286];
SASMean = SASMean[[2, 1]];
SASstderr = [9.4031790232, 11.205971747];
SASstderr = SASstderr[[2, 1]];
SASlrank = 3.1227121013;
SASwilcox = 2.651042239;
obj = dt << Survival( Y( :days ), Censor( :Censor ), Grouping( :Group ), Survival Plot( 1 ) );
rpt = obj << report;
mean = rpt[Number Col Box( "Mean" )] << get as matrix;
stdErr = rpt[Number Col Box( "Std Error" )] << get as matrix;
chiSq = rpt[Number Col Box( "ChiSquare" )] << get as matrix;
lrank = chiSq[1];
wilcox = chiSq[2];
Code Explanation:
- Open data table.
- Define SAS mean values.
- Rearrange SAS mean values.
- Define SAS standard error values.
- Rearrange SAS standard error values.
- Store SAS LRT value.
- Store SAS Wilcoxon value.
- Run survival analysis.
- Extract report object.
- Retrieve mean values.
- Retrieve standard error values.
- Retrieve chi-square values.
- Assign LRT value.
- Assign Wilcoxon value.
Example 15
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on a given data set, retrieving and extracting report objects along the way.
Code:
dt = Open("data_table.jmp");
plat = dt << Survival( Y( :Time ), Censor( :Censor ), Exponential Fit( 1, theta( 30000 ) ) );
Rep = Report( plat );
val = (Rep[Table Box( 1 )] << GetAsMatrix)[1, 1];
Close( dt, No Save );
dt = New Table( "Test", New Column( "L", Values( [1, 2, 8] ) ), New Column( "H", Values( [3, 5, 10] ) ) );
obj = dt << Survival( Y( L, H ) );
rpt = obj << report;
Code Explanation:
- Open data table.
- Perform survival analysis.
- Retrieve report object.
- Extract matrix value.
- Close data table without saving.
- Create new data table.
- Add columns with values.
- Perform survival analysis on new table.
- Retrieve report object for new analysis.
- Save report object.
Example 16
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, simulating 1000 datasets and extracting the 'Group' column.
Code:
dt = Open("data_table.jmp");
obj = dt << Survival(
Y( :days ),
Censor( :Censor ),
Grouping( :Group ),
Competing Causes( :Failure Cause ),
Weibull Lines( 1 ),
Failure Plot( 0 ),
Survival Plot( 1 )
);
dtnew = obj << simulate( 1000 );
dt_col = Column( dtnew, "Group" );
col_scpt = dt_col << get script;
charscpt = Char( Name Expr( col_scpt ) );
Code Explanation:
- Open data table;
- Perform survival analysis.
- Set response variable to "days".
- Define censor variable as "Censor".
- Use "Group" for grouping.
- Include "Failure Cause" for competing causes.
- Add Weibull lines.
- Disable failure plot.
- Enable survival plot.
- Simulate 1000 datasets.
- Extract "Group" column from new dataset.
- Get script for "Group" column.
- Convert script to character string.
Example 17
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, specifying response and censoring variables, fitting an exponential model, and extracting a value from the report object.
Code:
dt = Open("data_table.jmp");
plat = dt << Survival( Y( :Time ), Censor( :Censor ), Exponential Fit( 1, theta( 30000 ) ) );
Rep = Report( plat );
val = (Rep[Table Box( 1 )] << GetAsMatrix)[1, 1];
Code Explanation:
- Open data table.
- Perform survival analysis.
- Specify response variable.
- Specify censoring variable.
- Fit exponential model.
- Set initial theta value.
- Generate report object.
- Extract first table box.
- Convert to matrix.
- Retrieve first cell value.
Example 18
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, generating a survival report.
Code:
dt = Open("data_table.jmp");
exp xFrom = [6, 12, 48, 168, 500, 1000, 2000];
exp xTo = [6, 24, 48, 168, 500, 1000, 2000];
exp yFrom = [0.995783555867885, 0.994378074490513, 0.992971599137627, 0.991238664409638, 0.988889757621937, 0.981618509404101,
0.973636841057758];
exp yTo = [0.995783555867885, 0.994378074490513, 0.992971599137627, 0.991238664409638, 0.988889757621937, 0.981618509404101,
0.973636841057758];
obj = dt << Survival( Y( :start time, :end time ), Freq( :count ) );
rpt = obj << report;
Code Explanation:
- Open data table.
- Define experimental xFrom values.
- Define experimental xTo values.
- Define experimental yFrom values.
- Define experimental yTo values.
- Create survival analysis object.
- Generate survival report.
Example 19
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, retrieving a combined table and converting it to a matrix.
Code:
dt = Open("data_table.jmp");
plat = dt << Survival( Y( :start time, :end time ), Freq( :count ) );
rep = Report( plat );
result = rep["Combined"][Table Box( 1 )] << GetAsMatrix;
expected = [6 6 0.995783555867885 0.00421644413211525 0.00171772327438447,
12 24 0.994378074490513 0.005621925509487 0.00198205573822738,
48 48 0.992971599137627 0.00702840086237316 0.00221475212968978,
168 168 0.991238664409638 0.00876133559036203 0.00280817429974461,
500 500 0.988889757621937 0.0111102423780626 0.00365414864140573,
1000 1000 0.981618509404101 0.0183814905958986 0.00627680698629204,
2000 2000 0.973636841057758 0.0263631589422419 0.0100970600584676];
Code Explanation:
- Open data table.
- Perform survival analysis.
- Retrieve report object.
- Extract combined table.
- Convert table to matrix.
- Define expected values matrix.
- Compare results with expected values.
Example 20
Summary: Performs reliability growth analysis using the Piecewise Weibull NHPP model for change point detection on the BrakeReliability data set, generating confidence intervals and actual values.
Code:
dt = Open("data_table.jmp");
plat = dt << Survival( Y( :Time ), Censor( :Censor ) );
plat << Save Estimates;
dt2 = Data Table( 1 );
plow = [];
pup = [];
slow = [];
sup = [];
z = Normal Quantile( 0.975 );
e = 3.16;
For( i = 1, i <= N Row( dt2 ), i++,
p = Column( dt2, "Survival" )[i];
SE = Column( dt2, "SurvStdErr" )[i];
logitse = 1 / (p * (1 - p)) * SE;
pllow = Logit( p ) - z * logitse;
plup = Logit( p ) + z * logitse;
sllow = Logit( p ) - e * logitse;
slup = Logit( p ) + e * logitse;
plow |/= Squish( pllow );
pup |/= Squish( plup );
slow |/= Squish( sllow );
sup |/= Squish( slup );
);
SEActual = Column( dt2, 3 ) << GetAsMatrix;
plowActual = Column( dt2, 4 ) << GetAsMatrix;
pupActual = Column( dt2, 5 ) << GetAsMatrix;
slowActual = Column( dt2, 6 ) << GetAsMatrix;
supActual = Column( dt2, 7 ) << GetAsMatrix;
Fail_plowActual = Column( dt2, 9 ) << GetAsMatrix;
Fail_pupActual = Column( dt2, 10 ) << GetAsMatrix;
Fail_slowActual = Column( dt2, 11 ) << GetAsMatrix;
Fail_supActual = Column( dt2, 12 ) << GetAsMatrix;
Code Explanation:
- Open data table.
- Perform survival analysis.
- Save estimates.
- Access results data table.
- Initialize confidence interval lists.
- Define quantile value.
- Set multiplier for wider intervals.
- Loop through each row.
- Calculate survival probability.
- Compute standard error.
- Convert to logit scale.
- Calculate confidence limits.
- Adjust limits using Squish function.
- Retrieve actual SE values.
- Retrieve actual lower and upper limits.
- Retrieve actual failure limits.
Survival using Set Property
Example 1
Summary: Runs survival analysis with censoring on a data table, extracting summary reports as matrices, and modifying missing value codes.
Code:
dt = Open("data_table.jmp");
dt:Time << Set Property( "Missing Value Codes", 1150 );
surv1 = dt << Survival( Y( :Time ), Censor( :Censor ) );
rvec1 = Report( surv1 )["Summary"][Table Box( 1 )] << get as matrix;
dt:Time[dt << get rows where( Col Stored Value( :Time ) == 1150 )] = .;
surv2 = dt << Survival( Y( :Time ), Censor( :Censor ) );
rvec2 = Report( surv2 )["Summary"][Table Box( 1 )] << get as matrix;
dt = dt << Revert;
dt:Censor[1 :: 3] = 3;
dt:Censor << Set Property( "Missing Value Codes", {3} );
surv1 = dt << Survival( Y( :Time ), Censor( :Censor ) );
rvec1 = Report( surv1 )["Summary"][Table Box( 1 )] << get as matrix;
dt:Censor[dt << get rows where( Col Stored Value( :Censor ) == 3 )] = .;
surv2 = dt << Survival( Y( :Time ), Censor( :Censor ) );
rvec2 = Report( surv2 )["Summary"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table;
- Set missing value code for "Time" to 1150.
- Perform survival analysis on "Time" with censoring.
- Extract summary report as matrix.
- Replace 1150 in "Time" with missing values.
- Repeat survival analysis.
- Extract new summary report as matrix.
- Revert dataset to original state.
- Set first three "Censor" values to 3.
- Set missing value code for "Censor" to 3.
Example 2
Summary: Runs survival analysis with Cause Code and extracts report matrices for competing causes, demonstrating the impact of replacing missing values on the results.
Code:
dt = Open("data_table.jmp");
dt:Cause Code << Set Property( "Missing Value Codes", {0} );
surv1 = dt << Survival( Y( :Time Cycles ), Competing Causes( :Cause Code ) );
rvec1 = N Rows( Report( surv1 )["Competing Causes"][Table Box( 1 )] << get as matrix );
dt:Cause Code[dt << get rows where( Col Stored Value( :Cause Code ) == 0 )] = .;
surv2 = dt << Survival( Y( :Time Cycles ), Competing Causes( :Cause Code ) );
rvec2 = N Rows( Report( surv2 )["Competing Causes"][Table Box( 1 )] << get as matrix );
Code Explanation:
- Open data table.
- Set missing value code for Cause Code.
- Run survival analysis with Cause Code.
- Extract report matrix for competing causes.
- Replace missing values in Cause Code.
- Run survival analysis again.
- Extract new report matrix for competing causes.