BookmarkSubscribeRSS Feed
BlueNose
Quartz | Level 8

I was still thinking about your previous comment, with the logit, and it will not work, as I always have one observation with probability 1, and so the logit cannot be calculated for it.

 

Setting the probability back to 1 could work, however further in my program, I wish to add another scenario where I add 2% to the smoothed probabilities, and then I may have 2 probabilities of 1, which will "annoy" proc power.

 

How do you implement a spline effect in glimmix ?

EastwoodDC
Obsidian | Level 7

The basic code will look like this:

proc glimmix data=yourdata method=quad(qpoints=4); 
  effect splTime = spline(Time / knotmethod=equal(2));
  model Survival = splTime;
  output out=smoothed pred=smooth_survival;
run;

You may need to adjust the Number of knots (1 might be enough).

 

However, this won't contrain predicted survival to 1.0 at Time=0. I thought this could be done with the Parms statement, but I was mistaken. Instead, you could model the compliment of survival with no intercept, and that should do the trick.

 

data yourdata2;
set yourdata;
csurv = 1 - survival;
run ; proc glimmix data=yourdata2 method=quad(qpoints=4); effect splTime = spline(Time / knotmethod=equal(2)); model csurv = splTime / noint; output out=smoothed pred=smooth_csurv; run;

Then take the compliment of csurv to get back to the smoothed survival estimates you want.

I haven't ever tried to do quite what you are doing, as we always present the standard Kaplan-Meier curve. You should consider smoothing the upper and lower confidence bounds as well, to convey the uncertainty that goes along with this curve.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 16 replies
  • 4242 views
  • 6 likes
  • 4 in conversation