Programming the statistical procedures from SAS

Get confidence intervals of restricted cubic splines nadir value (lowest risk of the predictor)

Reply
New Contributor
Posts: 3

Get confidence intervals of restricted cubic splines nadir value (lowest risk of the predictor)

I'm studying the association between body mass index (BMI) and mortality in different cohorts. I´ve been running multivariable cox model restricted cubic splines using the macro lgtphcurv9 (https://cdn1.sph.harvard.edu/wp-content/uploads/sites/271/2012/09/lgtphcurv9_7-3-2011.pdf) to plot the association between BMI and mortality, which is u-shaped. I'm interested in the lowest risk BMI value and its 95% confidence interval. To get the lowest risk value, I just went to the output table which provides a long table with all the BMI values and the estimate (HR, which then is plotted in a figure), and record the lowest risk value. However, I'm struggling in getting 95% confidence intervals of this value. 

 

I understand that doing bootstrapping can be an option to create this 95% CI, but I dont know how to run bootstrapping through this macro...

can anybody help me with this?

thanks

Pablo 

Grand Advisor
Posts: 16,893

Re: Get confidence intervals of restricted cubic splines nadir value (lowest risk of the predictor)

 Bootstrapping involves selecting Subsamples and running it through the macro and collecting the parameter estimates. 

 

Usually I would recommend David Cassells paper - Don't be loopy, but without knowing your macro in detail (I'm not going to read 50+ pages) I'm not sure it can handle BY group processing. If it can, read Davids paper and follow that method otherwise, you can use the method not recommended in his paper, creating a macro that samples, calls the macro and collects the results. 

Super Contributor
Posts: 271

Re: Get confidence intervals of restricted cubic splines nadir value (lowest risk of the predictor)

You dont need bootstrapping. The confidence intervals can be calculated with use of the effect-statement, and the PROC PLM, which should be used after running phreg. Its quite easy, as this example shows.

 

*first generate some data;
data mydata; do i=1 to 10000; bmi=rand('uniform',0,10); time=rand('exponential',exp(-sin(bmi))); output; end; run;

*estimate the spline, and store the result file; proc phreg data=mydata; effect myspline=spline(bmi / knotmethod=list(1,2,3,4,5,6,7,8,9) naturalcubic); model time=myspline; store result; run;

*generate the number of bmi-values where the values should be calcuated; data template; do bmi=0 to 10 by 0.01; output; end; run;

*then calculate the curve; proc plm restore=result; score data=template out=predicted predicted=predicted lclm=lclm uclm=uclm; run;

*transform to hazard-ratio scale ; data predicted; set predicted; exppredicted=exp(predicted); explclm=exp(lclm); expuclm=exp(uclm); y=exp(sin(bmi)); ruN;

*plot it!; symbol1 i=join l=1 v=none color=black; symbol2 i=join l=2 v=none color=black; symbol3 i=join l=2 v=none color=black; symbol4 i=join l=1 v=none color=red; proc gplot data=predicted; plot (exppredicted explclm expuclm y)*bmi/overlay; run;
New Contributor
Posts: 3

Re: Get confidence intervals of restricted cubic splines nadir value (lowest risk of the predictor)

Thanks Jacob for your help,
what i really need though is the 95% of the bmi value... i.e: the lowest risk bmi value is 30, what is the 95% of that value? not the 95% CI of the estimate (HR or OR). because the spline analysis provides the lowest value, but is just a single value and no parameters of dispersion are provided...
the following paper states using STATA and they were able to calculate the 95% CI doing bootstrapping.. http://jamanetwork.com/journals/jama/fullarticle/2520627
thanks for your help
Grand Advisor
Posts: 16,893

Re: Get confidence intervals of restricted cubic splines nadir value (lowest risk of the predictor)

The paper you're referencing was for SAS 9.1 which is at least a decade old. It looks like,the functionality desired regarding cox regression model with spline has been implemented in SAS now. I would review Jacobs answer and assume that he's correct over my answer. 

 

Re finding the paper, search at Lexjansen.com, in general you can find a paper there on almost any SAS topic. 

New Contributor
Posts: 3

Re: Get confidence intervals of restricted cubic splines nadir value (lowest risk of the predictor)

Thanks Reeza,

can you provide more details to find Davis paper?

thanks!

pablo

Ask a Question
Discussion stats
  • 5 replies
  • 153 views
  • 3 likes
  • 3 in conversation