Example 50.1 Motorette Failure
This example fits a Weibull model and a lognormal model to the example given in Kalbfleisch and Prentice (1980, p. 5). An output data set called models is specified to contain the parameter estimates. By default, the natural log of the variable time is used by the procedure as the response. After this log transformation, the Weibull model is fit using the extreme-value baseline distribution, and the lognormal is fit using the normal baseline distribution.
Since the extreme-value and normal distributions do not contain any shape parameters, the variable SHAPE1 is missing in the models data set. An additional output data set, out, is created that contains the predicted quantiles and their standard errors for values of the covariate corresponding to temp=130 and temp=150. This is done with the control variable, which is set to 1 for only two observations.
Using the standard error estimates obtained from the output data set, approximate 90% confidence limits for the predicted quantities are then created in a subsequent DATA step for the log response. The logs of the predicted values are obtained because the values of the P= variable in the OUT= data set are in the same units as the original response variable, time. The standard errors of the quantiles of log(time) are approximated (using a Taylor series approximation) by the standard deviation of time divided by the mean value of time. These confidence limits are then converted back to the original scale by the exponential function.
The following statements produce Output 50.1.1:
title 'Motorette Failures With Operating Temperature as a Covariate';
data motors;
input time censor temp @@;
if _N_=1 then
do;
temp=130;
time=.;
control=1;
z=1000/(273.2+temp);
output;
temp=150;
time=.;
control=1;
z=1000/(273.2+temp);
output;
end;
if temp>150;
control=0;
z=1000/(273.2+temp);
output;
datalines;
8064 0 150 8064 0 150 8064 0 150 8064 0 150 8064 0 150
8064 0 150 8064 0 150 8064 0 150 8064 0 150 8064 0 150
1764 1 170 2772 1 170 3444 1 170 3542 1 170 3780 1 170
4860 1 170 5196 1 170 5448 0 170 5448 0 170 5448 0 170
408 1 190 408 1 190 1344 1 190 1344 1 190 1440 1 190
1680 0 190 1680 0 190 1680 0 190 1680 0 190 1680 0 190
408 1 220 408 1 220 504 1 220 504 1 220 504 1 220
528 0 220 528 0 220 528 0 220 528 0 220 528 0 220
;
run;
proc print data=motors;
run;
Output 50.1.1
Motorette Failure Data
. |
0 |
130 |
1 |
2.48016 |
. |
0 |
150 |
1 |
2.36295 |
1764 |
1 |
170 |
0 |
2.25632 |
2772 |
1 |
170 |
0 |
2.25632 |
3444 |
1 |
170 |
0 |
2.25632 |
3542 |
1 |
170 |
0 |
2.25632 |
3780 |
1 |
170 |
0 |
2.25632 |
4860 |
1 |
170 |
0 |
2.25632 |
5196 |
1 |
170 |
0 |
2.25632 |
5448 |
0 |
170 |
0 |
2.25632 |
5448 |
0 |
170 |
0 |
2.25632 |
5448 |
0 |
170 |
0 |
2.25632 |
408 |
1 |
190 |
0 |
2.15889 |
408 |
1 |
190 |
0 |
2.15889 |
1344 |
1 |
190 |
0 |
2.15889 |
1344 |
1 |
190 |
0 |
2.15889 |
1440 |
1 |
190 |
0 |
2.15889 |
1680 |
0 |
190 |
0 |
2.15889 |
1680 |
0 |
190 |
0 |
2.15889 |
1680 |
0 |
190 |
0 |
2.15889 |
1680 |
0 |
190 |
0 |
2.15889 |
1680 |
0 |
190 |
0 |
2.15889 |
408 |
1 |
220 |
0 |
2.02758 |
408 |
1 |
220 |
0 |
2.02758 |
504 |
1 |
220 |
0 |
2.02758 |
504 |
1 |
220 |
0 |
2.02758 |
504 |
1 |
220 |
0 |
2.02758 |
528 |
0 |
220 |
0 |
2.02758 |
528 |
0 |
220 |
0 |
2.02758 |
528 |
0 |
220 |
0 |
2.02758 |
528 |
0 |
220 |
0 |
2.02758 |
528 |
0 |
220 |
0 |
2.02758 |
The following statements produce Output 50.1.2 and Output 50.1.3:
proc lifereg data=motors outest=modela covout;
a: model time*censor(0)=z;
output out=outa quantiles=.1 .5 .9 std=std p=predtime
control=control;
run;
proc lifereg data=motors outest=modelb covout;
b: model time*censor(0)=z / dist=lnormal;
output out=outb quantiles=.1 .5 .9 std=std p=predtime
control=control;
run;
Output 50.1.2
Motorette Failure: Model A
The LIFEREG Procedure
WORK.MOTORS |
Log(time) |
censor |
0 |
30 |
17 |
13 |
0 |
0 |
3 |
Weibull |
-22.95148315 |
1 |
-11.8912 |
1.9655 |
-15.7435 |
-8.0389 |
36.60 |
<.0001 |
1 |
9.0383 |
0.9060 |
7.2626 |
10.8141 |
99.52 |
<.0001 |
1 |
0.3613 |
0.0795 |
0.2347 |
0.5561 |
|
|
1 |
2.7679 |
0.6091 |
1.7982 |
4.2605 |
|
|
Output 50.1.3
Motorette Failure: Model B
The LIFEREG Procedure
WORK.MOTORS |
Log(time) |
censor |
0 |
30 |
17 |
13 |
0 |
0 |
3 |
Lognormal |
-24.47381031 |
1 |
-10.4706 |
2.7719 |
-15.9034 |
-5.0377 |
14.27 |
0.0002 |
1 |
8.3221 |
1.2841 |
5.8052 |
10.8389 |
42.00 |
<.0001 |
1 |
0.6040 |
0.1107 |
0.4217 |
0.8652 |
|
|
The following statements produce Output 50.1.4:
data models;
set modela modelb;
run;
proc print data=models;
id _model_;
title 'fitted models';
run;
Output 50.1.4
Motorette Failure: Fitted Models
time |
PARMS |
Weibull |
0 Converged |
-22.9515 |
-1.0000 |
-11.8912 |
9.03834 |
0.36128 |
Intercept |
COV |
Weibull |
0 Converged |
-22.9515 |
-11.8912 |
3.8632 |
-1.77878 |
0.03448 |
z |
COV |
Weibull |
0 Converged |
-22.9515 |
9.0383 |
-1.7788 |
0.82082 |
-0.01488 |
Scale |
COV |
Weibull |
0 Converged |
-22.9515 |
0.3613 |
0.0345 |
-0.01488 |
0.00632 |
time |
PARMS |
Lognormal |
0 Converged |
-24.4738 |
-1.0000 |
-10.4706 |
8.32208 |
0.60403 |
Intercept |
COV |
Lognormal |
0 Converged |
-24.4738 |
-10.4706 |
7.6835 |
-3.55566 |
0.03267 |
z |
COV |
Lognormal |
0 Converged |
-24.4738 |
8.3221 |
-3.5557 |
1.64897 |
-0.01285 |
Scale |
COV |
Lognormal |
0 Converged |
-24.4738 |
0.6040 |
0.0327 |
-0.01285 |
0.01226 |
The following statements produce Output 50.1.5:
data out;
set outa outb;
run;
data out1;
set out;
ltime=log(predtime);
stde=std/predtime;
upper=exp(ltime+1.64*stde);
lower=exp(ltime-1.64*stde);
run;
title 'quantile estimates and confidence limits';
proc print data=out1;
id temp;
run;
title;
Output 50.1.5
Motorette Failure: Quantile Estimates and Confidence Limits
. |
0 |
1 |
2.48016 |
0.1 |
16519.27 |
5999.85 |
9.7123 |
0.36320 |
29969.51 |
9105.47 |
. |
0 |
1 |
2.48016 |
0.5 |
32626.65 |
9874.33 |
10.3929 |
0.30265 |
53595.71 |
19861.63 |
. |
0 |
1 |
2.48016 |
0.9 |
50343.22 |
15044.35 |
10.8266 |
0.29884 |
82183.49 |
30838.80 |
. |
0 |
1 |
2.36295 |
0.1 |
5726.74 |
1569.34 |
8.6529 |
0.27404 |
8976.12 |
3653.64 |
. |
0 |
1 |
2.36295 |
0.5 |
11310.68 |
2299.92 |
9.3335 |
0.20334 |
15787.62 |
8103.28 |
. |
0 |
1 |
2.36295 |
0.9 |
17452.49 |
3629.28 |
9.7672 |
0.20795 |
24545.37 |
12409.24 |
. |
0 |
1 |
2.48016 |
0.1 |
12033.19 |
5482.34 |
9.3954 |
0.45560 |
25402.68 |
5700.09 |
. |
0 |
1 |
2.48016 |
0.5 |
26095.68 |
11359.45 |
10.1695 |
0.43530 |
53285.36 |
12779.95 |
. |
0 |
1 |
2.48016 |
0.9 |
56592.19 |
26036.90 |
10.9436 |
0.46008 |
120349.65 |
26611.42 |
. |
0 |
1 |
2.36295 |
0.1 |
4536.88 |
1443.07 |
8.4200 |
0.31808 |
7643.71 |
2692.83 |
. |
0 |
1 |
2.36295 |
0.5 |
9838.86 |
2901.15 |
9.1941 |
0.29487 |
15957.38 |
6066.36 |
. |
0 |
1 |
2.36295 |
0.9 |
21336.97 |
7172.34 |
9.9682 |
0.33615 |
37029.72 |
12294.62 |