BookmarkSubscribeRSS Feed
nicogla
Calcite | Level 5

I want to implement a Hierarchical Bayes Model in SAS.

My model is a Hierarchical Bayes version of a Vector Auto-regressive Model with Covariates (VARX) where individual level covariates effects are drawn from a "segment/product-level" distribution, which is in turn drawn from a "population-level" distribution.

This is a quite complex model but I'd like to start with something simple like:

- Y_ijt=alpha_ij*X_ijt+eps_ijt (customer level equation: where i is the customer index, j is the segment/product index and t is the time.), where

- alpha_ij ~ N(alpha_j,sigma_j) (segment/product level equation) and

- alpha_j ~ N(alpha_0,sigma_0) (population level equation).

I know this model is not a VARX model but if I could start with a simple example that would help me to implement the complete estimator.

Does anyone have any experience with the estimation of such models in SAS?

Thanks in advance,

Nicolas

6 REPLIES 6
SteveDenham
Jade | Level 19

I've used PROC MCMC for some hierarchical models, but not for anything like this, so I don't have the experience needed to help much, other than to point you at the documentation and examples therein.

Steve Denham

bert_db
Calcite | Level 5

Dear,

Is this question not anwered somewhere else, because I have a similar problem? I work under SAS 9.3 and want to fit a hierarchical random effects model with 3 levels (e.g. school, class, student data with school and class random effects). All the examples I find only treat the 2 level case.

Thanks in advance,

Bert

SteveDenham
Jade | Level 19

I don't see anything that would work to do this in SAS.  You may need to look at the R package, which I think is called MCMCglmm.

Steve Denham

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

Check the latest documentation for PROC MCMC. I am pretty sure there is something on multiple levels. You would typically use so-called hierarchical centering.

SteveDenham
Jade | Level 19

On an interesting tangent, the PRIOR statement in MIXED looks like it might be applicable, as most hierarchical models are variance component models (the first restriction I ran into).

Back to MCMC--Example 59.8 in the SAS/STAT13.1 documentation has a multilevel example, which looks like it would be easy enough to generalize to this situation.

Steve Denham

bert_db
Calcite | Level 5

Thanks a lot for your help both, it was very helpful! My program works right now..

Bert

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1560 views
  • 0 likes
  • 4 in conversation