Thinking more about your problem. I wrote the following code to fit the GENMOD model with PROC MCMC, and the model you want to fit (intercept and parameters for all five levels of cat -- overparameterized). See the titles and comments to find out what happens.
proc glmmod data=test outdesign=testout;
title2 'get design matrix in file (all 0s and 1s)';
class cat drug;
model y = cat drug ;
run;
proc print data=testout;run;
data test2; merge test testout; *-combined;
run;
proc genmod data=test2;
title2 'using dummy variables -- same result as with class statement';
model y = col1-col8 / dist=Poisson link=log offset=logt noint;
bayes seed=1 nbi=10000 nmc=100000 thin=10;
run;
data NormalPrior2;
input _type_ $ col1-col8 ;
datalines;
Var 100 100 100 100 100 100 100 100
Mean -2.5 -1.4 0 0 0 0 0 0
;
run;
proc genmod data=test2;
title2 'using dummy variables -- same result as with class statement';
model y = col1-col8 / dist=Poisson link=log offset=logt noint;
bayes seed=1 coeffprior=normal(input=NormalPrior2) nbi=10000 nmc=100000 thin=10;
run;
*-good approach to fit the model fitted by GENMOD;
proc mcmc data=test2 nmc=50000 seed=1 thin=5 outpost=outpost;
title2 'with intercept, no cat5 level (i.e., no col6 dummy var.)';
title3 'noninformative priors -- analogous to GENMOD approach';
parms b1-b5 c1; *-b1 is intercept, b2-b6 for cat, c1 for drug1;
prior b: ~ normal(0,var=100);
prior c1 ~ normal(0,var=100);
eta = b1 + b2*col2 + b3*col3 +b4*col4 + b5*col5 + c1*col7 + logt;
f = exp(eta);
model y ~ Poisson(f);
run;
*-effort to use overparameterized model desired by the original poster. Terrible results.;
proc mcmc data=test2 nmc=50000 seed=1 thin=5outpost=outpost;
title2 'with intercept, and all FIVE levels of cat (col2-col6), overparameterized';
title3 'noninformative priors -- meaningless results, right now';
parms b1-b6 c1;
prior b: ~ normal(0,var=100);
prior c1 ~ normal(0,var=100);
eta = b1 + b2*col2 + b3*col3 +b4*col4 + b5*col5 + b6*col6 + c1*col7 + logt;
f = exp(eta);
model y ~ Poisson(f);
run;
*-attempt to use overparameterized model, but with highly informative prior on last parm;
proc mcmc data=test2 nmc=50000 seed=1 thin=5 outpost=outpost;
title2 'with intercept, and all five levels of cat (col2-col6), overparameterized';
title3 'but with highly informative b6 prior (for cat5 [col6] level) -- MAY be reasonable results';
parms b1-b6 c1;
prior b1 b2 b3 b4 b5 ~ normal(0,var=1000);
prior b6 ~ normal(1,var=.001); *-arbitrary highly informative prior on b6 ;
prior c1 ~ normal(0,var=1000);
eta = b1 + b2*col2 + b3*col3 +b4*col4 + b5*col5 + b6*col6 + c1*col7 + logt;
f = exp(eta);
model y ~ Poisson(f);
run;
*^above "works", but I can get any b6 estimate I want by changing the mean
of the prior on b6. Data is not influencing the posterior for b6 with this
prior. Moreover, posteriors for the other parameters are totally different from
that obtained in with the more reasonable model without a b6 parameter.
So, I am very skeptical of this.;
Good luck. Based on this quick-and-dirty programming effort, I am still skeptical of what you want to do. But there are many folks who are better Bayesians than I am.
... View more