An empty SAS dataset ('a') is created at the beginning of the script. This dataset serves only as a syntactic requirement for calling PROC MCMC, even though no data is actually processed or used from this dataset in the context of this prior simulation. The distributions are fully specified and generated by the MCMC procedure itself from their hyperparameters.
1 Code Block
DATA STEP Data
Explanation : This DATA STEP block creates an empty SAS dataset named 'a'. This dataset is a syntactic requirement for calling PROC MCMC, even though no data is actually processed or used from this dataset in the context of this prior simulation.
Copied!
data a;
run;
1
DATA a;
2
RUN;
2 Code Block
PROC MCMC
Explanation : This block uses the MCMC procedure to simulate the distributions of four parameters defined in the `parms` statement. Each parameter is assigned a specific prior distribution (Gamma or Inverse-Gamma) with its hyperparameters. The `data=a` option references the empty dataset created previously. `nmc=10000` specifies 10,000 iterations of the MCMC chain. `outpost=gout` directs the generated samples to the 'gout' dataset. `plots=density` requests the creation of density plots for the simulated prior distributions. The `model general(0)` statement indicates that this MCMC is a prior simulation unrelated to observed data. The ODS statements enable and disable graphical output, specifically selecting density panels.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : /****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: MCMCGSM */
/* TITLE: Simulation of Gamma and Inverse-Gamma Priors */
/* PRODUCT: STAT */
/* SYSTEM: ALL */
/* KEYS: */
/* PROCS: MCMC */
/* DATA: */
/* */
/* REF: PROC MCMC */
/* MISC: */
/****************************************************************/
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.