BookmarkSubscribeRSS Feed
mcarniello
Calcite | Level 5

There's an R package out there called WCE, which does proportional hazards modelling using weighted cumulative exposure.

 

Does anyone know of how something similar could be done in SAS? Perhaps using IML, or a combination of PROC and DATA steps?

 

We've tried PHREG, using a spline, and it's getting close-ish, but not exactly what this package does.

 

Thanks for any comment and notes!

 

https://cran.r-project.org/web/packages/WCE/index.html

"A flexible method for modeling cumulative effects of time-varying exposures, weighted according to their relative proximity in time, and represented by time-dependent covariates. The current implementation estimates the weight function in the Cox proportional hazards model. The function that assigns weights to doses taken in the past is estimated using cubic regression splines."

 

3 REPLIES 3
Rick_SAS
SAS Super FREQ

I suspect you'll get more responses if you show your PHREG code, the R code, and provide sample data. Also, let us know what the predictions of the R package are for a few example values. 

 

Since you claim the result is "close-ish," the issue could be the way you are specifying the knots. Please make sure that you are using B-splines and the same number of knots that the R packages uses. You might need to use the knotsWCE() function in the WCE package to make sure that SAS and R are putting knots at the same locations. Also, B-splines require external knots. The positions of the external knots determine the basis functions, so you need to know where R is placing the external knots. The SAS documentation includes a section that includes graphs that show a B-spline basis for various choices of knot placement: https://go.documentation.sas.com/doc/en/statcdc/14.2/statug/statug_introcom_sect023.htm 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1221 views
  • 1 like
  • 3 in conversation