The PHREG Procedure

Example 87.14 Bayesian Analysis of Piecewise Exponential Model

(View the complete code for this example.)

This example illustrates using a piecewise exponential model in a Bayesian analysis. Consider the Rats data set in the section Getting Started: PHREG Procedure. In the following statements, PROC PHREG is used to carry out a Bayesian analysis for the piecewise exponential model. In the BAYES statement, the option PIECEWISE stipulates a piecewise exponential model, and PIECEWISE=HAZARD requests that the constant hazards be modeled in the original scale. By default, eight intervals of constant hazards are used, and the intervals are chosen such that each has roughly the same number of events.

data Rats;
   label Days  ='Days from Exposure to Death';
   input Days Status Group @@;
   datalines;
143 1 0   164 1 0   188 1 0   188 1 0
190 1 0   192 1 0   206 1 0   209 1 0
213 1 0   216 1 0   220 1 0   227 1 0
230 1 0   234 1 0   246 1 0   265 1 0
304 1 0   216 0 0   244 0 0   142 1 1
156 1 1   163 1 1   198 1 1   205 1 1
232 1 1   232 1 1   233 1 1   233 1 1
233 1 1   233 1 1   239 1 1   240 1 1
261 1 1   280 1 1   280 1 1   296 1 1
296 1 1   323 1 1   204 0 1   344 0 1
;
proc phreg data=Rats;
   model Days*Status(0)=Group;
   bayes seed=1 piecewise=hazard statistics=(summary interval)
         diagnostics=(autocorr geweke ess);
run;

The "Model Information" table in Output 87.14.1 shows that the piecewise exponential model is being used.

Output 87.14.1: Model Information

The PHREG Procedure
 
Bayesian Analysis

Model Information
Data SetWORK.RATS 
Dependent VariableDaysDays from Exposure to Death
Censoring VariableStatus 
Censoring Value(s)0 
ModelPiecewise Exponential 
Sampling AlgorithmARMS 
Burn-In Size2000 
MC Sample Size10000 
Thinning1 


By default the time axis is partitioned into eight intervals of constant hazard. Output 87.14.2 details the number of events and observations in each interval. Note that the constant hazard parameters are named Lambda1,…, Lambda8. You can supply your own partition by using the INTERVALS= suboption within the PIECEWISE=HAZARD option.

Output 87.14.2: Interval Partition

Constant Hazard Time Intervals
IntervalNEventHazard
Parameter
[Lower,Upper)
017655Lambda1
176201.555Lambda2
201.521875Lambda3
218232.555Lambda4
232.5233.544Lambda5
233.5253.554Lambda6
253.528844Lambda7
288Infty54Lambda8


The model parameters consist of the eight hazard parameters Lambda1, …, Lambda8, and the regression coefficient Group. The maximum likelihood estimates are displayed in Output 87.14.3. Again, these estimates are used as the starting values for simulation of the posterior distribution.

Output 87.14.3: Maximum Likelihood Estimates

Maximum Likelihood Estimates
ParameterDFEstimateStandard
Error
95% Confidence Limits
Lambda110.0009530.0004430.0000840.00182
Lambda210.007940.003710.0006720.0152
Lambda310.01560.007340.001200.0300
Lambda410.02360.01150.001120.0461
Lambda510.36690.195900.7509
Lambda610.02760.014800.0566
Lambda710.02620.014600.0548
Lambda810.05450.031000.1152
Group1-0.62230.3468-1.30200.0573


Without using the PRIOR= suboption within the PIECEWISE=HAZARD option to specify the prior of the hazard parameters, the default is to use the noninformative and improper prior displayed in Output 87.14.4.

Output 87.14.4: Hazard Prior

Improper Prior for Hazards
ParameterPrior
Lambda11 / Lambda1
Lambda21 / Lambda2
Lambda31 / Lambda3
Lambda41 / Lambda4
Lambda51 / Lambda5
Lambda61 / Lambda6
Lambda71 / Lambda7
Lambda81 / Lambda8


The noninformative uniform prior is used for the regression coefficient Group (Output 87.14.5), as in the section Bayesian Analysis.

Output 87.14.5: Coefficient Prior

Uniform Prior for Regression
Coefficients
ParameterPrior
GroupConstant


Summary statistics for all model parameters are shown in Output 87.14.6 and Output 87.14.7.

Output 87.14.6: Summary Statistics

The PHREG Procedure
 
Bayesian Analysis

Posterior Summaries
ParameterNMeanStandard
Deviation
Percentiles
25%50%75%
Lambda1100000.0009450.0004440.0006240.0008760.00118
Lambda2100000.007820.003630.005190.007240.00979
Lambda3100000.01550.007350.01020.01440.0195
Lambda4100000.02360.01160.01520.02170.0297
Lambda5100000.36340.19650.21860.32660.4685
Lambda6100000.02780.01530.01660.02490.0356
Lambda7100000.02650.01510.01570.02360.0338
Lambda8100000.05580.03230.03220.04880.0721
Group10000-0.61540.3570-0.8569-0.6186-0.3788


Output 87.14.7: Interval Statistics

Posterior Intervals
ParameterAlphaEqual-Tail IntervalHPD Interval
Lambda10.0500.0002890.001990.0002080.00182
Lambda20.0500.002470.01650.001940.0152
Lambda30.0500.004840.03310.003410.0301
Lambda40.0500.006990.05150.004780.0462
Lambda50.0500.09060.83250.05410.7469
Lambda60.0500.006760.06540.004090.0580
Lambda70.0500.006140.06480.004210.0569
Lambda80.0500.01320.13680.006370.1207
Group0.050-1.31900.0893-1.33790.0652


The requested diagnostics—namely, lag1, lag5, lag10, lag50 autocorrelations (Output 87.14.8), the Geweke diagnostics (Output 87.14.9), and the effective sample size diagnostics (Output 87.14.10)—show a good mixing of the Markov chain.

Output 87.14.8: Autocorrelations

The PHREG Procedure
 
Bayesian Analysis

Posterior Autocorrelations
ParameterLag 1Lag 5Lag 10Lag 50
Lambda10.07050.00150.0017-0.0076
Lambda20.09090.0206-0.0013-0.0039
Lambda30.0861-0.00720.00110.0002
Lambda40.1447-0.00230.00810.0082
Lambda50.10860.0072-0.0038-0.0028
Lambda60.12810.0049-0.00360.0048
Lambda70.1925-0.00110.0094-0.0011
Lambda80.21280.0322-0.0042-0.0045
Group0.56380.0410-0.0003-0.0071


Output 87.14.9: Geweke Diagnostics

Geweke Diagnostics
ParameterzPr > |z|
Lambda1-0.07050.9438
Lambda2-0.49360.6216
Lambda30.57510.5652
Lambda41.05140.2931
Lambda50.89100.3729
Lambda60.29760.7660
Lambda71.65430.0981
Lambda80.66860.5038
Group-1.26210.2069


Output 87.14.10: Effective Sample Size

Effective Sample Sizes
ParameterESSAutocorrelation
Time
Efficiency
Lambda17775.31.28610.7775
Lambda26874.81.45460.6875
Lambda37655.71.30620.7656
Lambda46337.11.57800.6337
Lambda56563.31.52360.6563
Lambda66720.81.48790.6721
Lambda75968.71.67540.5969
Lambda85137.21.94660.5137
Group2980.43.35530.2980


Last updated: February 13, 2019