+ Reply to Thread
Results 1 to 6 of 6

Thread: Calculate estimated median survival time (by hand)

  1. #1
    Points: 10,858, Level: 69
    Level completed: 2%, Points required for next Level: 392

    Posts
    360
    Thanks
    24
    Thanked 19 Times in 18 Posts

    Calculate estimated median survival time (by hand)




    So I have some SAS code:


    Code: 
    proc lifereg data=surv_data;
       model event_time * censor(1) = var1 var2 var3 / distribution=weibull;
       output out=out_surv predicted=median;
    run;
    Anyway, I know from the OUTPUT OUT statement I can get a resulting estimated time until event based on an observation's values of VAR1 VAR2 and VAR3.

    Let's say the resulting parameter estimates are as follows:

    Intercept 16.1
    var1 -0.08
    var2 -.27
    var3 -.28

    scale .91
    weibull shape 1.1


    What would be the by hand calculation to get the same estimated median survival time for an observation.

    Let's say:
    var1 = 101
    var2 = 0
    var3 = 4

    The estimated median survival time is 519 (per OUTPUT OUT statement).....how would one calculate this number by hand (given the parameter estimates above)?
    Last edited by lancearmstrong1313; 12-10-2015 at 01:29 PM.

  2. #2
    Points: 10,858, Level: 69
    Level completed: 2%, Points required for next Level: 392

    Posts
    360
    Thanks
    24
    Thanked 19 Times in 18 Posts

    Re: Calculate estimated median survival time (by hand)

    So when I do the following:




    EXP(16.1+ (var1*-0.08) + (var2*-.27) + (var3*-.28) + (ln(-ln(1-.5))/1.1)

    EXP(intercept + B1*var1 + B2*var2 + ......+ Bx*varX + ln(-ln(1-%ile)) / shape)

    I get the same exact answers as what SAS outputs.



    The ln(-ln(1-.5) I saw on a SAS website (http://support.sas.com/documentation...eg_sect020.htm)

    Where the .5 represents the median.

    Just curious if anyone can confirm that this is truly how to calculate the estimated median survival by hand (it seems like it would be more than just coincidence that this got me exactly what SAS gave me).

  3. The Following User Says Thank You to lancearmstrong1313 For This Useful Post:

    hlsmith (12-10-2015)

  4. #3
    Omega Contributor
    Points: 38,253, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,989
    Thanks
    397
    Thanked 1,185 Times in 1,146 Posts

    Re: Calculate estimated median survival time (by hand)

    Much more complex than I have gone into it, I only run a survival model about once every couple of years. I always thought you just created the table with intervals and number of participants without results until you got to 50% of participant with/without event, so what is the difference based on what you are doing. Am I referring to the observed value and you are trying to get the expected value in a multiple HR Reg model?
    Stop cowardice, ban guns!

  5. #4
    Points: 10,858, Level: 69
    Level completed: 2%, Points required for next Level: 392

    Posts
    360
    Thanks
    24
    Thanked 19 Times in 18 Posts

    Re: Calculate estimated median survival time (by hand)

    I'm trying to get an estimated time until event for a single observation, not a whole cohort of folk, based on the observation's values for some variables (so yes, like a multiple regression model).

  6. #5
    Omega Contributor
    Points: 38,253, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,989
    Thanks
    397
    Thanked 1,185 Times in 1,146 Posts

    Re: Calculate estimated median survival time (by hand)

    Oh, so this is kind of like when you plug an observation's variable values into the logistic model (e.g., Beta_0 + X1*Beta_1 +,...), but you are not doing it for hazard ratio for event, but median time to event. I have never heard of such a thing.
    Stop cowardice, ban guns!

  7. #6
    TS Contributor
    Points: 14,811, Level: 78
    Level completed: 91%, Points required for next Level: 39
    Miner's Avatar
    Location
    Greater Milwaukee area
    Posts
    1,171
    Thanks
    34
    Thanked 405 Times in 363 Posts

    Re: Calculate estimated median survival time (by hand)


    The median survival time is just the 50th percentile when plotted on a Weibull probability plot.


    Be cautious how you use this. When calculating from heavily censored data, you can calculate impossible values. Your shape parameter was near 1, which is the exponential distribution, commonly used to model random failures. For example, if you were to calculate the mean survival time for a group of 30-something North Americans (with a shape parameter near 1), you would get a value of approximately 900 years, which is obviously impossible. This is because the hazard rate changes as the person ages.

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats