BookmarkSubscribeRSS Feed
isozealot
Calcite | Level 5

Dear all: 

 

I used restricted cubic spline (RCS) to plot the mortality hazard ratio of body mass index. The hazard ratio was adjusted by age, viral type, SOFA score, and bicarbionate.

However, there were two results of P-value for nonlinearity (Counts1 = 0.2264 and Counts2 = 0.6636).

Which one should i use?

 

截圖 2024-11-01 下午10.39.21.png

 

I used BMI=18.5 as the single knot. The following figure was the RCS plot.

 

截圖 2024-11-01 下午10.46.22.png

 

2 REPLIES 2
ballardw
Super User

Please include the code you submitted.

 

That way we have a chance of seeing all of the options that could have affected the creation of the output.

Rick_SAS
SAS Super FREQ

If you are getting 2 estimates, it means that you are using 3 knots for the splines. The procedure probably outputs a "SplineKnots" table, which will show the 3 values of the continuous variable at which the knots are placed. For example, see this example:

 

proc glmselect data=sashelp.cars;
   effect CONUTs = spline(Weight / details naturalcubic basis=tpf(noint)
             knotmethod=equal(3)); /* <== NOTE: 3 equally spaced knots */
   model mpg_city = CONUTs / selection=none;       /* fit model by using spline effects */
   ods select SplineKnots ParameterEstimates;
quit;

The three spline components are the Intercept, CONUTs_1, and CONUTS_2, The p-values indicate whether each component in the model is a significant predictor of the response variable. For more about the spline components (and how to visualize them), see https://blogs.sas.com/content/iml/2019/10/16/visualize-regression-splines.html 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 688 views
  • 2 likes
  • 3 in conversation