turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Get confidence intervals of restricted cubic splin...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-28-2016 12:58 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PabloLamelas

11-28-2016 01:07 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

11-28-2016 05:23 AM

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;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to JacobSimonsen

11-28-2016 10:15 AM

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

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PabloLamelas

11-28-2016 11:14 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

11-28-2016 10:16 AM

Thanks Reeza,

can you provide more details to find Davis paper?

thanks!

pablo