BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Arick
Fluorite | Level 6

Why doesn't PROC LIFREG Weibull parameter estimates match those that I used in the RAND function?

     Below is SAS code that generates subject survival data from a Weibull distribution using the RAND function. I then analyze the survival data with PROC LIFEREG, which outputs an estimate of the shape and scale parameters. Although the estimated shape parameter from PROC LIFEREG is approximately the same as used to generate the subject data, the scale parameter is not even close. So what exactly is “scale” estimate from PROC LIFEREG? Is there a way to estimate the Weibull parameters from PROC LIFEREG (or another SAS procedure)? Any help is appreciated

 

data X;

  call streaminit(2468);

 

  a=1.6; *Shape;

  b=4.0; *Scale;

 

  TRT=1;

  do Subject=1 to 10000;

    T=rand("Weibull", a, b);

    Event=(rand("Uniform")<0.20);

    output;

  end;

run;

 

proc lifereg data=X;

  model T*Event(0)=TRT / dist=Weibull;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @Arick and welcome to the SAS Support Communities!

 

I think it's easier to estimate the Weibull parameters with PROC UNIVARIATE:

ods select ParameterEstimates;
proc univariate data=X;
var T;
histogram / weibull;
run;

Result:

The UNIVARIATE Procedure
Fitted Weibull Distribution for T

Parameters for Weibull Distribution

Parameter   Symbol   Estimate

Threshold   Theta           0
Scale       Sigma    4.000363
Shape       C        1.604449
Mean                 3.585712
Std Dev              2.288696

EDIT: It appears that your censoring scheme impairs the estimation of the Weibull scale parameter by PROC LIFEREG. Without censoring, i.e., with Event=1 it works:

          Analysis of Maximum Likelihood Parameter Estimates

                          Standard   95% Confidence     Chi-
Parameter     DF Estimate    Error       Limits       Square Pr > ChiSq

Intercept      1   1.3922   0.0066   1.3793   1.4052 44678.9     <.0001
TRT            0   0.0000    .        .        .         .        .
Scale          1   0.6257   0.0049   0.6162   0.6353
Weibull Shape  1   1.5983   0.0125   1.5740   1.6229

Note that the Weibull scale estimate is exp(Intercept)≈4.0239, whereas the "Scale" in the output (s in the documentation) equals 1/(Weibull Shape).

 

You can simplify this by omitting the covariate in the MODEL statement:

proc lifereg data=X;
model T*Event(0)= / dist=Weibull;
run;

Result:

          Analysis of Maximum Likelihood Parameter Estimates

                          Standard   95% Confidence     Chi-
Parameter     DF Estimate    Error       Limits       Square Pr > ChiSq

Intercept      1   1.3922   0.0066   1.3793   1.4052 44678.9     <.0001
Scale          1   0.6257   0.0049   0.6162   0.6353
Weibull Scale  1   4.0239   0.0265   3.9722   4.0761
Weibull Shape  1   1.5983   0.0125   1.5740   1.6229

 

 

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @Arick and welcome to the SAS Support Communities!

 

I think it's easier to estimate the Weibull parameters with PROC UNIVARIATE:

ods select ParameterEstimates;
proc univariate data=X;
var T;
histogram / weibull;
run;

Result:

The UNIVARIATE Procedure
Fitted Weibull Distribution for T

Parameters for Weibull Distribution

Parameter   Symbol   Estimate

Threshold   Theta           0
Scale       Sigma    4.000363
Shape       C        1.604449
Mean                 3.585712
Std Dev              2.288696

EDIT: It appears that your censoring scheme impairs the estimation of the Weibull scale parameter by PROC LIFEREG. Without censoring, i.e., with Event=1 it works:

          Analysis of Maximum Likelihood Parameter Estimates

                          Standard   95% Confidence     Chi-
Parameter     DF Estimate    Error       Limits       Square Pr > ChiSq

Intercept      1   1.3922   0.0066   1.3793   1.4052 44678.9     <.0001
TRT            0   0.0000    .        .        .         .        .
Scale          1   0.6257   0.0049   0.6162   0.6353
Weibull Shape  1   1.5983   0.0125   1.5740   1.6229

Note that the Weibull scale estimate is exp(Intercept)≈4.0239, whereas the "Scale" in the output (s in the documentation) equals 1/(Weibull Shape).

 

You can simplify this by omitting the covariate in the MODEL statement:

proc lifereg data=X;
model T*Event(0)= / dist=Weibull;
run;

Result:

          Analysis of Maximum Likelihood Parameter Estimates

                          Standard   95% Confidence     Chi-
Parameter     DF Estimate    Error       Limits       Square Pr > ChiSq

Intercept      1   1.3922   0.0066   1.3793   1.4052 44678.9     <.0001
Scale          1   0.6257   0.0049   0.6162   0.6353
Weibull Scale  1   4.0239   0.0265   3.9722   4.0761
Weibull Shape  1   1.5983   0.0125   1.5740   1.6229

 

 

Arick
Fluorite | Level 6

Thank you so much for the easy and thorough explanation, FreelanceReinhard! This makes perfect sense. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 800 views
  • 3 likes
  • 2 in conversation