The GENMOD Procedure

Example 45.10 Bayesian Analysis of a Poisson Regression Model

(View the complete code for this example.)

This example illustrates a Bayesian analysis of a log-linear Poisson regression model. Consider the following data on patients from clinical trials. The data set is a subset of the data described in Ibrahim, Chen, and Lipsitz (1999).

data Liver;
   input X1-X6 Y;
   datalines;
19.1358    50.0110     51.000      0        0       1        3
23.5970    18.4959      3.429      0        0       1        9
20.0474    56.7699      3.429      1        1       0        6
28.0277    59.7836      4.000      0        0       1        6
28.6851    74.1589      5.714      1        0       1        1
18.8092    31.0630      2.286      0        1       1       61
28.7201    52.9178     37.286      1        0       1        6
21.3669    61.6603     54.143      0        1       1        6
23.7332    42.2904      0.571      1        0       1       21
20.4783    22.1260     19.000      1        0       1        6

   ... more lines ...   

17.0993    48.8384      3.000      0        0       0       9
19.1327    65.3425      2.571      1        0       0       1
17.3010    51.4493      4.429      1        0       0       6
;

The primary interest is in prediction of the number of cancerous liver nodes when a patient enters the trials, by using six other baseline characteristics. The number of nodes is modeled by a Poisson regression model with the six baseline characteristics as covariates. The response and regression variables are as follows:

Y

Number of Cancerous Liver Nodes

X1

Body Mass Index

X2

Age, in Years

X3

Time Since Diagnosis of Disease, in Weeks

X4

Two Biochemical Markers (each classified as normal=1 or abnormal=0)

X5

Anti Hepatitis B Antigen

X6

Associated Jaundice (yes=1, no=0)

Two analyses are performed using PROC GENMOD. The first analysis uses noninformative normal prior distributions, and the second analysis uses an informative normal prior for one of the regression parameters.

In the following BAYES statement, COEFFPRIOR=NORMAL specifies a noninformative independent normal prior distribution with zero mean and variance for each parameter.

The initial analysis is performed using PROC GENMOD to obtain Bayesian estimates of the regression coefficients by using the following SAS statements:

proc genmod data=Liver;
   model Y = X1-X6 / dist=Poisson link=log;
   bayes seed=1 coeffprior=normal;
run;

Maximum likelihood estimates of the model parameters are computed by default. These are shown in the "Analysis of Maximum Likelihood Parameter Estimates" table in Output 45.10.1.

Output 45.10.1: Maximum Likelihood Parameter Estimates

The GENMOD Procedure
 
Bayesian Analysis

Analysis Of Maximum Likelihood Parameter Estimates
ParameterDFEstimateStandard
Error
Wald 95% Confidence Limits
Intercept12.45080.22842.00322.8984
X11-0.00440.0080-0.02010.0114
X21-0.01350.0024-0.0181-0.0088
X31-0.00290.0022-0.00720.0014
X41-0.27150.0795-0.4272-0.1157
X510.32150.08320.15850.4845
X610.20770.08270.04560.3698
Scale01.00000.00001.00001.0000

Note:The scale parameter was held fixed.



Noninformative independent normal prior distributions with zero means and variances of were used in the initial analysis. These are shown in Output 45.10.2.

Output 45.10.2: Regression Coefficient Priors

The GENMOD Procedure
 
Bayesian Analysis

Independent Normal Prior for Regression
Coefficients
ParameterMeanPrecision
Intercept01E-6
X101E-6
X201E-6
X301E-6
X401E-6
X501E-6
X601E-6


Initial values for the Markov chain are listed in the "Initial Values and Seeds" table in Output 45.10.3. The random number seed is also listed so that you can reproduce the analysis. Since no seed was specified, the seed shown was derived from the time of day.

Output 45.10.3: MCMC Initial Values and Seeds

Initial Values of the Chain
ChainSeedInterceptX1X2X3X4X5X6
112.450813-0.00435-0.01347-0.00291-0.271490.3215070.207713


Summary statistics for the posterior sample are displayed in the "Fit Statistics," "Descriptive Statistics for the Posterior Sample," "Interval Statistics for the Posterior Sample," and "Posterior Correlation Matrix" tables in Output 45.10.4, Output 45.10.5, Output 45.10.6, and Output 45.10.7, respectively. Since noninformative prior distributions for the regression coefficients were used, the mean and standard deviations of the posterior distributions for the model parameters are close to the maximum likelihood estimates and standard errors.

Output 45.10.4: Fit Statistics

Fit Statistics
DIC (smaller is better)829.810
pD (effective number of parameters)7.005


Output 45.10.5: Descriptive Statistics

The GENMOD Procedure
 
Bayesian Analysis

Posterior Summaries
ParameterNMeanStandard
Deviation
Percentiles
25%50%75%
Intercept100002.44830.23202.29032.44932.6093
X110000-0.004750.00809-0.0101-0.004660.000851
X210000-0.01340.00237-0.0150-0.0134-0.0118
X310000-0.003030.00220-0.00445-0.00298-0.00150
X410000-0.27030.0799-0.3241-0.2725-0.2190
X5100000.32020.08280.26420.32090.3775
X6100000.21060.08380.15330.21110.2663


Output 45.10.6: Interval Statistics

Posterior Intervals
ParameterAlphaEqual-Tail IntervalHPD Interval
Intercept0.0501.99032.90592.02892.9321
X10.050-0.02090.0108-0.02110.0106
X20.050-0.0181-0.00870-0.0184-0.00908
X30.050-0.007610.00105-0.007450.00113
X40.050-0.4257-0.1063-0.4314-0.1152
X50.0500.15630.48040.15740.4811
X60.0500.04500.37770.04680.3788


Output 45.10.7: Posterior Sample Correlation Matrix

Posterior Correlation Matrix
ParameterInterceptX1X2X3X4X5X6
Intercept1.000-0.708-0.432-0.046-0.261-0.185-0.422
X1-0.7081.000-0.202-0.047-0.0350.0780.129
X2-0.432-0.2021.0000.0350.0760.0540.117
X3-0.046-0.0470.0351.0000.027-0.042-0.077
X4-0.261-0.0350.0760.0271.000-0.0240.127
X5-0.1850.0780.054-0.042-0.0241.000-0.037
X6-0.4220.1290.117-0.0770.127-0.0371.000


Posterior sample autocorrelations for each model parameter are shown in Output 45.10.8. The autocorrelation after 10 lags is negligible for all parameters, indicating good mixing in the Markov chain.

Output 45.10.8: Posterior Sample Autocorrelations

The GENMOD Procedure
 
Bayesian Analysis

Posterior Autocorrelations
ParameterLag 1Lag 5Lag 10Lag 50
Intercept0.30370.01520.0095-0.0170
X10.33980.00250.00030.0052
X20.30360.00610.0003-0.0062
X30.34890.0190-0.0064-0.0210
X40.28680.02130.0157-0.0107
X50.28540.0108-0.0288-0.0012
X60.30780.02300.00730.0062


The p-values for the Geweke test statistics shown in Output 45.10.9 all indicate convergence of the MCMC. See the section Assessing Markov Chain Convergence in Chapter 7: Introduction to Bayesian Analysis Procedures, for more information about convergence diagnostics and their interpretation.

Output 45.10.9: Geweke Diagnostic Statistics

Geweke Diagnostics
ParameterzPr > |z|
Intercept-0.65330.5135
X10.34180.7325
X20.36090.7182
X3-0.33450.7380
X40.28510.7755
X5-0.52660.5985
X61.12850.2591


The effective sample sizes for each parameter are shown in Output 45.10.10.

Output 45.10.10: Effective Sample Sizes

Effective Sample Sizes
ParameterESSAutocorrelation
Time
Efficiency
Intercept4880.32.04910.4880
X14844.22.06430.4844
X25139.31.94580.5139
X34551.22.19720.4551
X44953.62.01870.4954
X55330.51.87600.5331
X64988.12.00480.4988


Trace, autocorrelation, and density plots for the seven model parameters are shown in Output 45.10.11 through Output 45.10.17. All indicate satisfactory convergence of the Markov chain.

Output 45.10.11: Diagnostic Plots for Intercept

Diagnostic Plots for Intercept


Output 45.10.12: Diagnostic Plots for X1

Diagnostic Plots for X1


Output 45.10.13: Diagnostic Plots for X2

Diagnostic Plots for X2


Output 45.10.14: Diagnostic Plots for X3

Diagnostic Plots for X3


Output 45.10.15: Diagnostic Plots for X4

Diagnostic Plots for X4


Output 45.10.16: Diagnostic Plots for X5

Diagnostic Plots for X5


Output 45.10.17: Diagnostic Plots for X6

Diagnostic Plots for X6


In order to illustrate the use of an informative prior distribution, suppose that researchers expect that a unit increase in body mass index (X1) will be associated with an increase in the mean number of nodes of between 10% and 20%, and they want to incorporate this prior knowledge in the Bayesian analysis. For log-linear models, the mean and linear predictor are related by . If X1 and X1 are two values of body mass index, and are the two mean values, and all other covariates remain equal for the two values of X1, then

so that for a unit change in X1,

If , then , or . This gives you guidance in specifying a prior distribution for the for body mass index. Taking the mean of the prior normal distribution to be the midrange of the values of , and taking to be the extremes of the range, an is the resulting prior distribution. The second analysis uses this informative normal prior distribution for the coefficient of X1 and uses independent noninformative normal priors with zero means and variances equal to for the remaining model regression parameters.

In the following BAYES statement, COEFFPRIOR=NORMAL(INPUT=NormalPrior) specifies the normal prior distribution for the regression coefficients with means and variances contained in the data set NormalPrior.

An analysis is performed using PROC GENMOD to obtain Bayesian estimates of the regression coefficients by using the following SAS statements:

data NormalPrior;
   input _type_ $ Intercept X1-X6;
   datalines;
Var  1e6   0.0005      1e6      1e6      1e6      1e6      1e6
Mean 0.0   0.1385      0.0      0.0      0.0      0.0      0.0
;
proc genmod data=Liver;
   model Y = X1-X6 / dist=Poisson link=log;
   bayes seed=1 plots=none coeffprior=normal(input=NormalPrior);
run;

The prior distributions for the regression parameters are shown in Output 45.10.18.

Output 45.10.18: Regression Coefficient Priors

The GENMOD Procedure
 
Bayesian Analysis

Independent Normal Prior for Regression
Coefficients
ParameterMeanPrecision
Intercept01E-6
X10.13852000
X201E-6
X301E-6
X401E-6
X501E-6
X601E-6


Initial values for the MCMC are shown in Output 45.10.19. The initial values of the covariates are joint estimates of their posterior modes. The prior distribution for X1 is informative, so the initial value of X1 is further from the MLE than the rest of the covariates. Initial values for the rest of the covariates are close to their MLEs, since noninformative prior distributions were specified for them.

Output 45.10.19: MCMC Initial Values and Seeds

Initial Values of the Chain
ChainSeedInterceptX1X2X3X4X5X6
112.142820.010595-0.01434-0.00301-0.280620.3349830.231213


Goodness-of-fit, summary, and interval statistics are shown in Output 45.10.20. Except for X1, the statistics shown in Output 45.10.20 are very similar to the previous statistics for noninformative priors shown in Output 45.10.4 through Output 45.10.7. The point estimate for X1 is now positive. This is expected because the prior distribution on is quite informative. The distribution reflects the belief that the coefficient is positive. The distribution places the majority of its probability density on positive values. As a result, the posterior density of places more likelihood on positive values than in the noninformative case.

Output 45.10.20: Fit Statistics

Fit Statistics
DIC (smaller is better)833.074
pD (effective number of parameters)6.869

The GENMOD Procedure
 
Bayesian Analysis

Posterior Summaries
ParameterNMeanStandard
Deviation
Percentiles
25%50%75%
Intercept100002.14190.21571.99652.14302.2894
X1100000.01030.006840.005730.01040.0150
X210000-0.01430.00233-0.0159-0.0142-0.0127
X310000-0.003180.00218-0.00467-0.00314-0.00170
X410000-0.28060.0800-0.3336-0.2793-0.2266
X5100000.33410.08320.27880.33410.3906
X6100000.23330.08260.17740.23250.2880

Posterior Intervals
ParameterAlphaEqual-Tail IntervalHPD Interval
Intercept0.0501.72252.55741.72932.5632
X10.050-0.003440.0235-0.003450.0234
X20.050-0.0188-0.00970-0.0189-0.00980
X30.050-0.007570.00108-0.007330.00121
X40.050-0.4365-0.1200-0.4391-0.1256
X50.0500.16570.49660.16820.4987
X60.0500.06950.39590.07250.3981