- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am working with a data, which is at customer x week x tier level and has other features- P1, P2, P3 and Sales. Treating Sales as a dependent variable and P1, P2 and P3 as independent variables I am planning to run a Bayesian regression model. Additionally, I would like to randomize this model at tier level(there are 4 tiers in the data). For e.g- if Model is Sales = B0+ B1*P1+ B2*P2+B3*P3, I would expect 4 intercepts B0 for each tier, 4 slopes B1 for each tier and so on.
I explored GENMOD, but it seems GENMOD does not support randomization. Next, I tested BGLIMM which seems to have worked best in my case but my current SAS version does not support BGLIMM. Lastly, I am left with only PROC MCMC. I have used below codes:
proc mcmc data=baymdb outpost=PostOut_re nmc=100 thin=5;
ods select Parameters REparameters PostSumInt tracepanel;
parms B0-B3 S2 ;
parms S2g 1;
prior B: ~ normal(0, var=1e6);
prior S2 ~ igamma(0.01, scale = 0.01);
prior S2g ~ general(0, lower=0);
random theta ~ normal(0,var=S2g) subject=tier ;
Mu = B0 + B1*P1 + B2*P2 +B3*P3 + theta ;
model LN_AHC_ENTNRX_ONE ~ normal(Mu,var=S2);
run;
However, the output of the above model does not have intercepts and estimates at tier level. I am seeing only overall level B0, B1, B2, B3.
Is there anything I am missing or if there is any other procedure which I could use? Thanks in advance for your help.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the suggestion. This helped. I just had to made slight changes with the way I define intercept level random effect estimates:
prior B: ~ normal(0, var=1e6);
prior S2 ~ igamma(0.01, scale = 0.01);
prior S2g ~ general(0, lower=0);
random b0 ~ normal(0,var=S2g) subject=tier monitor=(b0) ;
random b1~ normal(0,var=S2g) subject=tier monitor=(b1);
random b2~ normal(0,var=S2g) subject=tier monitor=(b2);
random b2~ normal(0,var=S2g) subject=tier monitor=(b3);
Mu = (B0+b0) + (B1+b1)*P1 + (B2+b2)*P2 +(B3+b3)*P3 ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
They are in the model via the RANDOM statement, but you will need to add the MONITOR= option on the RANDOM statement to see their distributions actually reported in the output.
random theta ~ normal(0,var=S2g) subject=tier monitor=(theta);
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the suggestion. This helped. I just had to made slight changes with the way I define intercept level random effect estimates:
prior B: ~ normal(0, var=1e6);
prior S2 ~ igamma(0.01, scale = 0.01);
prior S2g ~ general(0, lower=0);
random b0 ~ normal(0,var=S2g) subject=tier monitor=(b0) ;
random b1~ normal(0,var=S2g) subject=tier monitor=(b1);
random b2~ normal(0,var=S2g) subject=tier monitor=(b2);
random b2~ normal(0,var=S2g) subject=tier monitor=(b3);
Mu = (B0+b0) + (B1+b1)*P1 + (B2+b2)*P2 +(B3+b3)*P3 ;