Hello,
I have built the below model in PROC GENMOD and would like to rewrite it using PROC MCMC. I wanted to play around with the MCMC procedure and some of its additional options (e.g., Hamiltonian, etc.), but first I wanted to make sure I rewrote my prior model correctly.
Current model:
data normalPrior_sen;
input _type_ $ Intercept Teaching_Service0;
datalines;
Var 0.5 0.5
Mean 0.0 0.15
;
run;
ods graphics on;
title "Bayes with skeptical prior PP";
proc genmod data = post_fin descending ;
where discord GE 0 and discord LT 1;
class Teaching_service;
model Trans_ppi = Teaching_service / dist=binomial link = log;
estimate 'Beta' Teaching_service 1 -1/ exp;
lsmeans Teaching_service / e exp diff cl;
bayes
seed=10231995
nbi=50000
nmc=50000
thinning=5
diagnostics=all
statistics=all
coeffprior=normal(input=NormalPrior_sen)
outpost=post_PP_W;
store logit_bayes_PP_W;
run;
Of note, notice the attempt to use "dist=binomial" and "link = log" to get at the rate difference estimates in the GENMOD code. My attempt to rewrite the code is below. I would also be interested in how to set the reference group for the covariate within PROC MCMC, so switching the binary variable Teaching_service 's reference group to 1 instead of 0.
ods graphics on;
PROC MCMC DATA=post_fin
seed=10231995
outpost=logit_bayes_sen_mcmc
nbi=50000
nmc=50000
nthin=5
DIC
statistics=all
diagnostics=all;
where discord GE 0 and discord LT 1;
parms (beta0 beta1);
prior beta0 ~ normal(0, var=0.5);
prior beta1 ~ normal(0.15, var=0.5);
/* prior beta0 ~ normal(0, var=1000);
prior beta1 ~ normal(0, var=1000); */
p = logistic(beta0 + beta1*Teaching_Service);
model Trans_ppi ~ binomial(1,p); /*n=number of parameters from input dataset, (e.g., 1)*/
ods select PostSummaries PostIntervals;
run;
ods graphics off;
Thank you in advance for your time and help.
... View more