cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
shaohuazhan
Level II

Restricted cubic splines with survival data

In one paper (PMID: 29240540),Multivariate Cox proportional hazards regression models with restricted cubic splines (RCS) and adaptive splines were used to demonstrate the continuous relationship between patient age and papillary thyroid cancer (PTC) specific mortality,and the results were showed in the following figureImage 1.png

I do the same thing in JMP using the "Fit Proportional Hazards":

1.Select Analyze > Reliability and Survival > Fit Proportional Hazards.

2.Populate the Time to Event and Censor boxes with the appropriate columns.

3.Add age and tumor size to the construct model effects.

4.Click the red triangle next to "Attributes," and select Knotted Spline Effect . Type 3 knots , and click OK.

5.Click Run in the Model Specification dialog box.

6.Click the red triangle next to Proportional Hazards Fit, and select Risk Ratios

7.The results are showed in the following figure,but the output can not be obtained as the paper Image 2.jpg

Therefore,I do the same thing in JMP using the "Fit Parametric Survival":

1.Select Analyze > Reliability and Survival > Fit Parametric Survival.

2.Populate the Time to Event and Censor boxes with the appropriate columns.

3.Add age and tumor size to the construct model effects.

4.Click the red triangle next to "Attributes," and select Knotted Spline Effect . Type 3 knots , and click OK.

5.Click Run in the Model Specification dialog box.

6.Click the red triangle next to Parametric Survival Fit, and select Save probability formula.Dose Fitted failure probalility just like Hazard Ratio(HR) in the Cox survival anlysis?

7.Click the red triangle next to Parametric Survival Fit, and select Distribution Profiler, Dose the output have the same meanings as the paper in the following figure Image 3.jpg

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Restricted cubic splines with survival data

It seems that you are able to fit the model you desire because you obtained the risk ratios that you wanted or expected. The problem is what to do after the fit. The Cox proportional hazard model in JMP is limited. It does not provide any profiler and you cannot save the estimated model as a column formula.

 

The parametric survival model, though, can save the estimated probability model for you. This is the CDF for the selected life distribution model (e.g. Weibull). Construct a second column with a formula for the hazard. Copy the saved probability formula first. Paste it in the new formula and change the function name from "Distribution" to "Density." (For example, Weibull Distribution to Weibull Density.) click divide, enter 1, click subtract, and paste the probability function again. You should now have the hazard or PDF / (1-CDF).

 

You can profiler this hazard using Graph > Profiler or Graph Builder, depending on your purpose.

View solution in original post

Re: Restricted cubic splines with survival data

The reference for the range risk ratios is the minimum value of the regressor variable. There is no reference for the unit risk ratio. You can use it with any reference you like.

 

You can estimate the hazard at age=45 and again at any other age.

View solution in original post

12 REPLIES 12

Re: Restricted cubic splines with survival data

First, since the point of the paper is that there is a difference in the hazard function based on the wild type, you need to cross Age and Tumor Size to estimate and test the interaction effect. This change is true for both types of models that you tried.

 

Second, the prediction profiler is profiling the probability of mortality, not the hazard of mortality. The hazard function is based on the probability density function (PDF) and the cumulative distribution function (CDF): PDF / (1-CDF). You can create a column formula using these probability functions for a chosen distribution in JMP. The estimated parameters can be used as the arguments to these probability functions. You can then plot the function with Graph Builder against Age and Tumor Size or with filtering.

 

I don't know if the spline transform is necessary but if so, then click the red triangle and select Save Columns > Prediction Formula.

shaohuazhan
Level II

Re: Restricted cubic splines with survival data

Thanks for your help. However,it is still difficult for me to perform the survival analysis according to your kind suggestions. Could you demonstrate the detailed steps for me to perform? My purpose is to analysis the continuous relationship between patient age and survival time (such as the survival data in VA lung cancer from the Sample data) using multivariate Cox proportional hazards regression models with restricted cubic splines (RCS) .Finally i will obtained the following similar figure.

Image 3.jpg

Re: Restricted cubic splines with survival data

It seems that you are able to fit the model you desire because you obtained the risk ratios that you wanted or expected. The problem is what to do after the fit. The Cox proportional hazard model in JMP is limited. It does not provide any profiler and you cannot save the estimated model as a column formula.

 

The parametric survival model, though, can save the estimated probability model for you. This is the CDF for the selected life distribution model (e.g. Weibull). Construct a second column with a formula for the hazard. Copy the saved probability formula first. Paste it in the new formula and change the function name from "Distribution" to "Density." (For example, Weibull Distribution to Weibull Density.) click divide, enter 1, click subtract, and paste the probability function again. You should now have the hazard or PDF / (1-CDF).

 

You can profiler this hazard using Graph > Profiler or Graph Builder, depending on your purpose.

shaohuazhan
Level II

Re: Restricted cubic splines with survival data

Thanks again for your kind suggestions.However, i have an another question. There are two types of Risk Ratios in the Cox proportional hazard model, including  per unit change in regressor and per change in regressor over entire range in JMP.Although the parametric survival model can save the hazard or PDF / (1-CDF) for me according to your suggestions,what is the reference for Risk Ratios in the hazard of mortality? also per unit change in regressor or per change in regressor over entire range? when i analysis the continuous relationship between patient age and survival time according to your suggestions,whether i can set the age of 45 years as the reference for hazard calculation?

Re: Restricted cubic splines with survival data

The reference for the range risk ratios is the minimum value of the regressor variable. There is no reference for the unit risk ratio. You can use it with any reference you like.

 

You can estimate the hazard at age=45 and again at any other age.

shaohuazhan
Level II

Re: Restricted cubic splines with survival data

Furthermore,according to your suggestions,the values of Hazard or PDF / (1-CDF) are very small ( <0.0001). The following figure is my results and the formula of Hazard.something wrong?Image 1.jpgImage 2.jpg

 

Re: Restricted cubic splines with survival data

The estimated Weibull distribution shape parameter is nearly 1 (i.e., 1 / 1.096387964 ), so the hazard is nearly constant (slightly decreasing with increasing life).

shaohuazhan
Level II

Re: Restricted cubic splines with survival data

Thank you Mark,

I found that the following sets could analyze the continuous factor KPS and survival time ( VA lung cancer from the Sample data): Analyze > Fit Model, Personality: Generalized Regression; Distribution: Cox Proportional Hazards. Finally, obtain the following figure. What means about the Hazard Profiler? How could i calculate the 95% CI of Hazard?

Image 2.jpg

In the Hazard Profiler, I could output the Grid table or Random table, but what I need is the Hazard values corresponding to the original KPS values. Therefore, i could profiler the hazard and KPS using Graph Builder.

 

Thanks

Shaohua Zhan

Re: Restricted cubic splines with survival data

Click the red triangle next to Maximum Likelihood and select Save Columns > Save Survival Formula. But you can't save the hazard function, as far as I can tell.