

{"id":13403,"date":"2018-04-13T11:12:47","date_gmt":"2018-04-13T11:12:47","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=13403"},"modified":"2021-12-03T10:35:37","modified_gmt":"2021-12-03T05:05:37","slug":"stat-bayesian-analysis","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/","title":{"rendered":"6 SAS\/STAT Bayesian Analysis Procedures You Must Know"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1983,&quot;href&quot;:&quot;https:\\\/\\\/support.sas.com\\\/rnd\\\/app\\\/stat\\\/procedures\\\/BayesianAnalysis.html&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20230130115842\\\/http:\\\/\\\/support.sas.com\\\/rnd\\\/app\\\/stat\\\/procedures\\\/BayesianAnalysis.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-10 15:10:08&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-03 14:18:26&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-20 09:42:01&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-30 19:03:23&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-12 16:56:56&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-16 23:45:17&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-21 15:03:40&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-24 23:04:22&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-27 23:05:29&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-29 08:09:21&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-12 05:10:26&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-05-12 05:10:26&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>We looked at<a href=\"https:\/\/data-flair.training\/blogs\/sas-stat-anova\/\"><strong> SAS ANOVA (analysis of variance)<\/strong><\/a> in the previous tutorial, today we will be looking at SAS\/STAT Bayesian Analysis Procedure. Moreover, we will see how Bayesian Analysis Procedure is used in SAS\/STAT for computing different models. Our focus here will be to understand different procedures that can be used for Bayesian analysis through the use of examples.<br \/>\nSo, let&#8217;s start<strong><a href=\"https:\/\/data-flair.training\/blogs\/stat-software\/\"> SAS\/STAT<\/a><\/strong> Bayesian Analysis Procedure.<\/p>\n<h3>SAS\/STAT Bayesian Analysis<\/h3>\n<p>SAS\/ STAT Bayesian analysis is a statistical procedure that helps us in answering research questions about unknown parameters using probability statements.<\/p>\n<p>Bayesian Analysis example- what is the probability that the average female height is between 60 and 70 inches? What is the probability that people in a particular state vote for Congress or vote BJP? What is the probability that treatment A is more cost-effective than treatment B for a specific health care provider?<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/stat-software-features\/\">Let&#8217;s Learn SAS\/STAT Software Features<\/a><\/strong><\/p>\n<p>These statements are very common in the SAS\/STAT Bayesian analysis because of the underlying assumption that all parameters are random quantities. In a SAS\/STAT Bayesian analysis, a parameter is summarized by an entire distribution of values instead of one fixed value.<\/p>\n<p>A posterior distribution comprises a prior distribution of a parameter and a likelihood model providing information about the parameter based on observed data.<\/p>\n<div id=\"attachment_13409\" style=\"width: 295px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/bayesian-analysis-sample-image-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13409\" class=\"wp-image-13409 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/bayesian-analysis-sample-image-1.png\" alt=\"SAS STAT bayesian analysis\" width=\"285\" height=\"177\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/bayesian-analysis-sample-image-1.png 285w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/bayesian-analysis-sample-image-1-150x93.png 150w\" sizes=\"auto, (max-width: 285px) 100vw, 285px\" \/><\/a><p id=\"caption-attachment-13409\" class=\"wp-caption-text\">SAS STAT bayesian analysis<\/p><\/div>\n<h3>Calculating Bayesian Analysis in SAS\/STAT<\/h3>\n<p>SAS\/STAT Software uses the following procedures to compute Bayesian analysis of a sample data. Each procedure has a different syntax and is used with different type of data in different contexts. Let us explore each one of these.<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/stat-software-advantages\/\">Read About SAS\/STAT Software Advantages &amp; Disadvantages<\/a><\/strong><\/p>\n<div id=\"attachment_13435\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Procedures-for-calculating-Bayesian-Analysis-in-SASSTAT-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13435\" class=\"wp-image-13435 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Procedures-for-calculating-Bayesian-Analysis-in-SASSTAT-01.jpg\" alt=\"Calculating Bayesian Analysis in SAS\/STAT\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Procedures-for-calculating-Bayesian-Analysis-in-SASSTAT-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Procedures-for-calculating-Bayesian-Analysis-in-SASSTAT-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Procedures-for-calculating-Bayesian-Analysis-in-SASSTAT-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Procedures-for-calculating-Bayesian-Analysis-in-SASSTAT-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Procedures-for-calculating-Bayesian-Analysis-in-SASSTAT-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-13435\" class=\"wp-caption-text\">How to Calculate Bayesian Analysis in SAS\/STAT<\/p><\/div>\n<h4>a. SAS PROC BCHOICE<\/h4>\n<p>The PROC BCHOICE procedure in SAS\/STAT (Bayesian choice) procedure performs Bayesian analysis for discrete choice models. Discrete choice models are derived under the assumption of utility-maximizing behavior by decision makers. When individuals are asked to make one choice among a set of alternatives, they usually determine the level of utility that each alternative offers.<br \/>\n<strong>SAS PROC BCHOICE Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">PROC BCHOICE\u00a0DATASET;\r\nCLASS variable;\r\nMODEL response &lt;(response-options)&gt;\u00a0=\u00a0&lt;fixed-effects&gt; &lt;\/ model-options&gt;;<\/pre>\n<p><strong>SAS PROC BCHOICE Example-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">data Chocolates;\r\n\u00a0\u00a0 input Subj Choice brown white choco_chips;\r\n\u00a0\u00a0 datalines;\r\n1 0 0 0 0\r\n1 0 0 0 1\r\n1 0 0 1 0\r\n2 0 0 0 0\r\n2 0 0 0 1\r\n2 0 0 1 0\r\n2 0 0 1 1\r\n3 0 0 0 0\r\n3 0 0 0 1\r\n4 0 0 0 0\r\n4 0 0 0 1\r\n4 0 1 0 1\r\n5 0 0 1 0\r\n5 0 0 1 1\r\n5 0 1 1 1\r\n6 0 0 0 0\r\n6 0 0 0 1\r\n7 0 0 0 0\r\n7 0 1 1 0\r\n7 0 1 1 1\r\n8 0 0 0 0\r\n8 0 0 0 1\r\n8 0 0 1 0\r\n8 0 0 1 1\r\n8 0 1 0 0\r\n8 1 1 0 1\r\n8 0 1 1 0\r\n8 0 1 1 1\r\n9 0 0 0 0\r\n9 0 0 0 1\r\n9 0 0 1 0\r\n9 0 0 1 1\r\n9 0 1 0 0\r\n9 1 1 0 1\r\n9 0 1 1 0\r\n9 0 1 1 1\r\n10 0 0 0 0\r\n10 0 0 0 1\r\n;\r\nproc print data=Chocolates (obs=16);\r\nrun;\r\nods graphics on;\r\nproc bchoice data=Chocolates;\r\n\u00a0\u00a0 class brown(ref='0') white(ref='0') choco_chips(ref='0') Subj;\r\n\u00a0\u00a0 model Choice = brown white choco_chips \/ choiceset=(Subj) cprior=normal(var=1000);\r\nrun;<\/pre>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-ods-tutorial\/\">Let&#8217;s Revise SAS ODS (Output Delivery Systems)<\/a><\/strong><br \/>\nThe PROC BCHOICE and MODEL statements are required statements.<strong>\u00a0\u00a0<\/strong><\/p>\n<div id=\"attachment_13410\" style=\"width: 305px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13410\" class=\"wp-image-13410 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-1.png\" alt=\"SAS STAT bayesian analysis\" width=\"295\" height=\"379\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-1.png 295w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-1-117x150.png 117w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-1-234x300.png 234w\" sizes=\"auto, (max-width: 295px) 100vw, 295px\" \/><\/a><p id=\"caption-attachment-13410\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211; SAS PROC BCHOICE<\/p><\/div>\n<div id=\"attachment_13411\" style=\"width: 356px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13411\" class=\"wp-image-13411 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-2.png\" alt=\"SAS STAT bayesian analysis\" width=\"346\" height=\"654\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-2.png 346w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-2-79x150.png 79w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-2-159x300.png 159w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/a><p id=\"caption-attachment-13411\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0 &#8211;\u00a0SAS PROC BCHOICE<\/p><\/div>\n<div id=\"attachment_13412\" style=\"width: 344px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13412\" class=\"wp-image-13412 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-3.png\" alt=\"SAS STAT bayesian analysis\" width=\"334\" height=\"259\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-3.png 334w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-3-150x116.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-3-300x233.png 300w\" sizes=\"auto, (max-width: 334px) 100vw, 334px\" \/><\/a><p id=\"caption-attachment-13412\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211; SAS PROC BCHOICE<\/p><\/div>\n<div id=\"attachment_13413\" style=\"width: 669px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-4.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13413\" class=\"wp-image-13413 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-4.png\" alt=\"SAS STAT bayesian analysis\" width=\"659\" height=\"548\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-4.png 659w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-4-150x125.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-4-300x249.png 300w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/a><p id=\"caption-attachment-13413\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC BCHOICE<\/p><\/div>\n<div id=\"attachment_13414\" style=\"width: 652px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-5.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13414\" class=\"wp-image-13414 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-5.png\" alt=\"SAS STAT bayesian analysis\" width=\"642\" height=\"484\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-5.png 642w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-5-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-5-300x226.png 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/a><p id=\"caption-attachment-13414\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC BCHOICE<\/p><\/div>\n<div id=\"attachment_13415\" style=\"width: 653px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-6.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13415\" class=\"wp-image-13415 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-6.png\" alt=\"SAS STAT bayesian analysis\" width=\"643\" height=\"483\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-6.png 643w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-6-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-bchoice-output-6-300x225.png 300w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><p id=\"caption-attachment-13415\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC BCHOICE<\/p><\/div>\n<h4>b. SAS PROC FMM<\/h4>\n<p>The PROC FMM procedure in SAS\/STAT Software fits statistical models to data for which the distribution of the response is a finite mixture of distributions\u2014that is, each response is drawn with unknown probability from one of several distributions.<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-frequency-distribution\/\">Let&#8217;s Learn SAS Frequency Distribution Using SAS PROC FREQ<\/a><\/strong><br \/>\n<strong style=\"font-family: Verdana, Geneva, sans-serif\">SAS PROC FMM\u00a0Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">PROC FMM dataset;\r\nmodel &lt;VARIABLES&gt;;\r\noutput DATASET;<\/pre>\n<p><strong>\u00a0<\/strong><br \/>\nThe PROC FMM and MODEL statements are required.<br \/>\nThe MODEL statement defines elements of the mixture model, such as the model effects, the distribution, and the link function.<br \/>\nThe OUTPUT statement creates a data set that contains observations statistics that are computed after fitting the model.\u00a0By default, all variables in the original data set are included in the output data set.<br \/>\nIn the below example, the dist= option specifies the kind of distribution we want. Because our variable is a continuous one, we have taken normal distribution here.<br \/>\n<strong>SAS PROC FMM Example-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">proc fmm data=sashelp.class;\r\nmodel age=\/ dist=normal;\r\noutput out= class class=ML;\r\nRUN;<\/pre>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-arithmetic-mean\/\">Let&#8217;s Discuss SAS Arithmetic Mean \u2013 SAS PROC MEANS Tutorial<\/a><\/strong><\/p>\n<div id=\"attachment_13416\" style=\"width: 430px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13416\" class=\"wp-image-13416 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-1.png\" alt=\"SAS STAT bayesian analysis\" width=\"420\" height=\"555\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-1.png 420w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-1-114x150.png 114w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-1-227x300.png 227w\" sizes=\"auto, (max-width: 420px) 100vw, 420px\" \/><\/a><p id=\"caption-attachment-13416\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC FMM<\/p><\/div>\n<div id=\"attachment_13417\" style=\"width: 309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13417\" class=\"wp-image-13417 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-2.png\" alt=\"SAS STAT bayesian analysis\" width=\"299\" height=\"254\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-2.png 299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-2-150x127.png 150w\" sizes=\"auto, (max-width: 299px) 100vw, 299px\" \/><\/a><p id=\"caption-attachment-13417\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC FMM<\/p><\/div>\n<div id=\"attachment_13418\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13418\" class=\"wp-image-13418 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-3.png\" alt=\"SAS STAT bayesian analysis\" width=\"650\" height=\"495\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-3.png 650w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-3-150x114.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/PROC-FMM-OUTPUT-3-300x228.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><p id=\"caption-attachment-13418\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC FMM<\/p><\/div>\n<h4>c. SAS PROC GENMOD<\/h4>\n<p>The PROC GENMOD provides Bayesian analysis for distributions like binomial, gamma, Gaussian, normal and Poisson. It also provides Bayesian analysis for links like identity, log, logit, probit etc. In a Bayesian analysis, the model parameters are treated as random variables, and inference about parameters is based on the posterior distribution of the parameters, given the data.<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-histogram-statement\/\">Read About SAS Histogram Statement With UNIVARIATE Procedure<\/a><\/strong><br \/>\n<strong>SAS Proc GENMOD Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">PROC GENMOD dataset;\r\n\u00a0\u00a0\u00a0\u00a0 model &lt;dependent variable&gt;;\r\nbayes &lt;options&gt;;<\/pre>\n<p>Here, MODEL statement signifies the dependent and the independent variable. In the below example, height is the dependent variable and age is the independent variable.<br \/>\nThe Bayes statement signifies that we are performing a Bayesian analysis in SAS\/STAT.<br \/>\n<strong>SAS Proc FMM Example-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">proc genmod data=sashelp.class;\r\nmodel height=age \/ dist=normal;\r\nbayes outpost=class;\r\nrun;<\/pre>\n<p>Here the outpost = option saves samples (posterior) to the POST dataset.<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-fishers-exact-test\/\">DO You Know How to Apply Fishers Exact Test in SAS Using PROC FREQ Procedure<\/a><\/strong><br \/>\nThe first table produced in the output provides some usual classical inferences, but all the subsequent tables provide Bayesian analysis.<br \/>\nIn the above example, the dist= option specifies the kind of distribution we want. Because our variable is a continuous one, we have taken normal distribution here.<br \/>\nThe GENMOD procedure also uses ODS Graphics to create graphs as part of its output.<strong>\u00a0<\/strong><\/p>\n<div id=\"attachment_13420\" style=\"width: 480px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13420\" class=\"wp-image-13420 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-1.png\" alt=\"SAS STAT bayesian analysis\" width=\"470\" height=\"661\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-1.png 470w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-1-107x150.png 107w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-1-213x300.png 213w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/a><p id=\"caption-attachment-13420\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC GENMOD<\/p><\/div>\n<div id=\"attachment_13421\" style=\"width: 542px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13421\" class=\"wp-image-13421 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-2.png\" alt=\"SAS STAT bayesian analysis\" width=\"532\" height=\"658\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-2.png 532w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-2-121x150.png 121w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-2-243x300.png 243w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><\/a><p id=\"caption-attachment-13421\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC GENMOD<\/p><\/div>\n<div id=\"attachment_13422\" style=\"width: 474px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13422\" class=\"wp-image-13422 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-3.png\" alt=\"SAS STAT bayesian analysis\" width=\"464\" height=\"436\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-3.png 464w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-3-150x141.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-3-300x282.png 300w\" sizes=\"auto, (max-width: 464px) 100vw, 464px\" \/><\/a><p id=\"caption-attachment-13422\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC GENMOD<\/p><\/div>\n<div id=\"attachment_13423\" style=\"width: 725px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-4.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13423\" class=\"wp-image-13423 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-4.png\" alt=\"SAS STAT bayesian analysis\" width=\"715\" height=\"546\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-4.png 715w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-4-150x115.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-4-300x229.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/a><p id=\"caption-attachment-13423\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC GENMOD<\/p><\/div>\n<div id=\"attachment_13424\" style=\"width: 662px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-5.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13424\" class=\"wp-image-13424 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-5.png\" alt=\"SAS STAT bayesian analysis\" width=\"652\" height=\"499\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-5.png 652w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-5-150x115.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-5-300x230.png 300w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/a><p id=\"caption-attachment-13424\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC GENMOD<\/p><\/div>\n<div id=\"attachment_13425\" style=\"width: 671px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-6.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13425\" class=\"wp-image-13425 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-6.png\" alt=\"SAS STAT bayesian analysis\" width=\"661\" height=\"501\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-6.png 661w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-6-150x114.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-genmod-output-6-300x227.png 300w\" sizes=\"auto, (max-width: 661px) 100vw, 661px\" \/><\/a><p id=\"caption-attachment-13425\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC GENMOD<\/p><\/div>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/sas-merge-datasets\/\"><strong>Let&#8217;s Explore\u00a0How to Join\/Combine Data Sets in SAS<\/strong><\/a><\/p>\n<h4>d. SAS PROC LIFEREG<\/h4>\n<p>The PROC LIFEREG procedure in SAS\/STAT fits parametric models to data that can be uncensored, right censored, left censored, or interval censored.\u00a0The models for the response variable consist of a linear effect composed of the covariates and a random disturbance term.<\/p>\n<p>Bayesian analysis of parametric survival models can be requested by using the BAYES statement in the LIFEREG procedure.<br \/>\n<strong>SAS Proc LIFEREG Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">PROC LIFEREG dataset;\r\nmodel VARIABLE;<\/pre>\n<p><strong>Example-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">data one;\r\ninput y x cen;\r\ncards;\r\n12\u00a0 2\u00a0 0\r\n12\u00a0 3\u00a0 1\r\n14\u00a0 1\u00a0 1\r\n67\u00a0 3\u00a0 1\r\n43\u00a0 2\u00a0 1\r\n78\u00a0 1\u00a0 1\r\n;\r\nods graphics on;\r\nproc lifereg data=one;\r\nmodel y= \/ dist=exponential;\r\nrun;<\/pre>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-software\/\">Let&#8217;s Discuss Types of Software in SAS Programming language<\/a><\/strong><\/p>\n<div id=\"attachment_13426\" style=\"width: 278px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13426\" class=\"wp-image-13426 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-1.png\" alt=\"SAS STAT bayesian analysis\" width=\"268\" height=\"577\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-1.png 268w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-1-70x150.png 70w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-1-139x300.png 139w\" sizes=\"auto, (max-width: 268px) 100vw, 268px\" \/><\/a><p id=\"caption-attachment-13426\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC LIFEREG<\/p><\/div>\n<div id=\"attachment_13427\" style=\"width: 503px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13427\" class=\"wp-image-13427 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-2.png\" alt=\"SAS STAT bayesian analysis\" width=\"493\" height=\"219\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-2.png 493w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-2-150x67.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-lifereg-output-2-300x133.png 300w\" sizes=\"auto, (max-width: 493px) 100vw, 493px\" \/><\/a><p id=\"caption-attachment-13427\" class=\"wp-caption-text\">SAS STAT Bayesian Analysis &#8211;\u00a0SAS PROC LIFEREG<\/p><\/div>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-environment\/\">Let&#8217;s revise SAS Environment Setup<\/a><\/strong><\/p>\n<h4>e. SAS PROC MCMC<\/h4>\n<p>The MCMC procedure is a general purpose simulation procedure that uses Markov chain Monte Carlo (MCMC) techniques to fit Bayesian models.<\/p>\n<p>PROC MCMC draws samples from a random posterior distribution (posterior\u00a0probability\u00a0distribution\u00a0is the probability\u00a0distribution\u00a0of an unknown quantity, treated as a random variable, conditional on the evidence obtained from an experiment or survey), and uses these samples to approximate the data distribution.<\/p>\n<p>You need to specify only parameters, prior distributions, and a likelihood function.<br \/>\n<strong>SAS PROC MCMC Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">PROC MCMC dataset;\r\n\u00a0\u00a0 PARMS &lt;list of parameters&gt;;\r\n\u00a0\u00a0 PRIOR &lt;type of distribution of each parameter&gt;;\r\n\u00a0\u00a0 MODEL &lt;variable used as likelihood&gt;;<\/pre>\n<p><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><br \/>\n<strong>SAS PROC MCMC\u00a0Example-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">ods graphics on;\r\nproc mcmc data=sashelp.class ;\r\n\u00a0\u00a0 parms b0 0 b1 0;\r\n\u00a0\u00a0 parms sigma2 1;\r\n\u00a0\u00a0 prior b0 b1 ~ normal(mean = 5, var = 1e6);\r\n\u00a0\u00a0 prior sigma2 ~ igamma(shape = 2\/10, scale = 10\/4);\r\n\u00a0\u00a0 mu = b0 + b1*height;\r\n\u00a0\u00a0 model height ~ n(mu, var = sigma2);\r\nrun;<\/pre>\n<p><strong>\u00a0<\/strong><br \/>\nHere, height is a likelihood function specified in the model, ~ sign indicates that we want to specify a distribution for our data. Here likelihood is a normal distribution with mean (mu) and variance (sigma<sup>2<\/sup>).<br \/>\nThe b0, b1 and sigma2 are parameters used with a parms statement. These are names given by us.<br \/>\nThe MODEL statement also automatically compensates missing data.<br \/>\nThe PROC MCMC also supports univariate or multivariate distributions.<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-syntax\/\">Follow this link to know about\u00a0SAS Syntax Cheat Sheet<\/a><\/strong><\/p>\n<div id=\"attachment_13428\" style=\"width: 447px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13428\" class=\"wp-image-13428 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-1.png\" alt=\"SAS STAT bayesian analysis\" width=\"437\" height=\"567\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-1.png 437w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-1-116x150.png 116w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-1-231x300.png 231w\" sizes=\"auto, (max-width: 437px) 100vw, 437px\" \/><\/a><p id=\"caption-attachment-13428\" class=\"wp-caption-text\">SAS STAT Bayesian Procedure &#8211;\u00a0SAS PROC MCMC<\/p><\/div>\n<div id=\"attachment_13429\" style=\"width: 665px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13429\" class=\"wp-image-13429 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-2.png\" alt=\"SAS STAT bayesian analysis\" width=\"655\" height=\"522\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-2.png 655w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-2-150x120.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-2-300x239.png 300w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/a><p id=\"caption-attachment-13429\" class=\"wp-caption-text\">SAS STAT Bayesian Procedure &#8211;\u00a0SAS PROC MCMC<\/p><\/div>\n<div id=\"attachment_13430\" style=\"width: 656px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13430\" class=\"wp-image-13430 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-3.png\" alt=\"SAS STAT bayesian analysis\" width=\"646\" height=\"502\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-3.png 646w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-3-150x117.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-3-300x233.png 300w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/a><p id=\"caption-attachment-13430\" class=\"wp-caption-text\">SAS STAT Bayesian Procedure &#8211;\u00a0SAS PROC MCMC<\/p><\/div>\n<div id=\"attachment_13431\" style=\"width: 675px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-4.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13431\" class=\"wp-image-13431 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-4.png\" alt=\"SAS STAT bayesian analysis\" width=\"665\" height=\"506\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-4.png 665w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-4-150x114.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-mcmc-output-4-300x228.png 300w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/a><p id=\"caption-attachment-13431\" class=\"wp-caption-text\">SAS STAT Bayesian Procedure &#8211;\u00a0SAS PROC MCMC<\/p><\/div>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-functions\/\">Related topic- SAS Functions \u2013 Arithmetic, Character, Date and Time, Truncation<\/a><\/strong><\/p>\n<h4>f. SAS PROC PHREG<\/h4>\n<p>The PROC PHREG procedure in SAS\/STAT performs survival analysis of data. Many types of models have been used for survival data. Two of the more popular types of models are the accelerated failure time model (Kalbfleisch and Prentice\u00a01980) and the Cox proportional hazards model (Cox\u00a01972). The PHREG procedure performs a regression analysis of survival data based on the Cox proportional hazards model.<br \/>\n<strong>SAS PROC PHREG Syntax-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">PROC PHREG \u00a0dataset;\r\n\u00a0\u00a0 model response &lt;*censor(list)&gt;\u00a0=\u00a0&lt;effects&gt; &lt;\/ options&gt;;\r\n\u00a0 bayes &lt;\/ options&gt;;<\/pre>\n<p>The PROC PHREG and MODEL statements are required statements.<br \/>\n<strong>SAS PROC PHREG\u00a0Example-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">ods graphics on;\r\nproc phreg data=sashelp.cars ;\r\n\u00a0\u00a0 model horsepower*length(0) = cylinders;\r\n\u00a0 bayes outpost=cars;\r\nrun;<\/pre>\n<p>By using ODS Graphics, PROC PHREG allows you to plot the survival curve for CYLINERS GROUP.<br \/>\nThe BAYES statement invokes the Bayesian analysis.<br \/>\nthe OUTPOST= option saves the posterior distribution samples in a SAS data set for post-processing.<br \/>\nThe &#8220;Model Information&#8221; table below summarizes information about the model you fit and the size of the simulation.<br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/read-raw-data-in-sas\/\">Do You Know How to Enter and Read Raw Data in SAS<\/a><\/strong><br \/>\nSo, this was all\u00a0About SAS\/STAT\u00a0Bayesian Analysis Procedure Tutorial. Hope you like our explanation.<\/p>\n<div id=\"attachment_13432\" style=\"width: 417px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13432\" class=\"wp-image-13432 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-1.png\" alt=\"SAS STAT bayesian analysis\" width=\"407\" height=\"587\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-1.png 407w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-1-104x150.png 104w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-1-208x300.png 208w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><\/a><p id=\"caption-attachment-13432\" class=\"wp-caption-text\">SAS STAT Bayesian Procedure &#8211;\u00a0SAS PROC PHREG<\/p><\/div>\n<div id=\"attachment_13433\" style=\"width: 326px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13433\" class=\"wp-image-13433 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-3.png\" alt=\"SAS STAT bayesian analysis\" width=\"316\" height=\"401\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-3.png 316w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-3-118x150.png 118w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-3-236x300.png 236w\" sizes=\"auto, (max-width: 316px) 100vw, 316px\" \/><\/a><p id=\"caption-attachment-13433\" class=\"wp-caption-text\">SAS STAT Bayesian Procedure &#8211;\u00a0SAS PROC PHREG<\/p><\/div>\n<div id=\"attachment_13434\" style=\"width: 682px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13434\" class=\"wp-image-13434 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-2.png\" alt=\"SAS STAT bayesian analysis\" width=\"672\" height=\"552\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-2.png 672w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-2-150x123.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/proc-phreg-output-2-300x246.png 300w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/a><p id=\"caption-attachment-13434\" class=\"wp-caption-text\">SAS STAT Bayesian\u00a0Procedure &#8211;\u00a0SAS PROC PHREG<\/p><\/div>\n<h3>Conclusion<\/h3>\n<p>Hence, this was a complete description and a comprehensive understanding of all the procedure offered by SAS\/STAT Bayesian Analysis. We looked at each of them:\u00a0PROC PHREG, PROC MCMC, PROC LIFEREG, PROC GENMOD, PROC FMM, and PROC BCHOICE with their syntax, and how they can be used.<\/p>\n<p>Hope you all enjoyed it. Stay tuned for more.\u00a0Furthermore, if you have any query feel free to ask in a comment section.<br \/>\nRelated Topic-\u00a0<strong><a href=\"https:\/\/data-flair.training\/blogs\/sas-bar-chart\/\">Simple, Stacked &amp; Clustered Bar Charts in SAS<\/a><\/strong><br \/>\n<strong><a href=\"https:\/\/support.sas.com\/rnd\/app\/stat\/procedures\/BayesianAnalysis.html\">For reference\u00a0<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We looked at SAS ANOVA (analysis of variance) in the previous tutorial, today we will be looking at SAS\/STAT Bayesian Analysis Procedure. Moreover, we will see how Bayesian Analysis Procedure is used in SAS\/STAT&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":13408,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[12130,12132,12146,12147,12151,12152,12162,12163,12166,12167,12176,12177,12333],"class_list":["post-13403","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sas-stat","tag-sas-proc-bchoice","tag-sas-proc-bchoice-syntax","tag-sas-proc-fmm-example","tag-sas-proc-fmm-syntax","tag-sas-proc-genmod-example","tag-sas-proc-genmod-syntax","tag-sas-proc-lifereg-example","tag-sas-proc-lifereg-syntax","tag-sas-proc-mcmc-example","tag-sas-proc-mcmc-syntax","tag-sas-proc-phreg-example","tag-sas-proc-phreg-syntax","tag-sasstat-bayesian-analysis"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>6 SAS\/STAT Bayesian Analysis Procedures You Must Know - DataFlair<\/title>\n<meta name=\"description\" content=\"SAS\/STAT Bayesian Analysis Procure- How to calculate Bayesian Analysis in SAS\/STAT, PROC PHREG, PROC MCMC, PROC LIFEREG, PROC GENMOD, PROC FMM, PROC BCHOICE\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"6 SAS\/STAT Bayesian Analysis Procedures You Must Know - DataFlair\" \/>\n<meta property=\"og:description\" content=\"SAS\/STAT Bayesian Analysis Procure- How to calculate Bayesian Analysis in SAS\/STAT, PROC PHREG, PROC MCMC, PROC LIFEREG, PROC GENMOD, PROC FMM, PROC BCHOICE\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-13T11:12:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-03T05:05:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/SAS-STAT-bayesian-analysis-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"6 SAS\/STAT Bayesian Analysis Procedures You Must Know - DataFlair","description":"SAS\/STAT Bayesian Analysis Procure- How to calculate Bayesian Analysis in SAS\/STAT, PROC PHREG, PROC MCMC, PROC LIFEREG, PROC GENMOD, PROC FMM, PROC BCHOICE","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/","og_locale":"en_US","og_type":"article","og_title":"6 SAS\/STAT Bayesian Analysis Procedures You Must Know - DataFlair","og_description":"SAS\/STAT Bayesian Analysis Procure- How to calculate Bayesian Analysis in SAS\/STAT, PROC PHREG, PROC MCMC, PROC LIFEREG, PROC GENMOD, PROC FMM, PROC BCHOICE","og_url":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-04-13T11:12:47+00:00","article_modified_time":"2021-12-03T05:05:37+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/SAS-STAT-bayesian-analysis-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"6 SAS\/STAT Bayesian Analysis Procedures You Must Know","datePublished":"2018-04-13T11:12:47+00:00","dateModified":"2021-12-03T05:05:37+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/"},"wordCount":1642,"commentCount":1,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/SAS-STAT-bayesian-analysis-01.jpg","keywords":["SAS PROC BCHOICE","SAS PROC BCHOICE Syntax","SAS PROC FMM Example","SAS PROC FMM Syntax","SAS Proc GENMOD Example","SAS Proc GENMOD Syntax","SAS Proc LIFEREG Example","SAS Proc LIFEREG Syntax","SAS PROC MCMC eXAMPLE","SAS PROC MCMC Syntax","SAS PROC PHREG Example","SAS PROC PHREG Syntax","SAS\/STAT Bayesian Analysis"],"articleSection":["SAS - STAT Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/","url":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/","name":"6 SAS\/STAT Bayesian Analysis Procedures You Must Know - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/SAS-STAT-bayesian-analysis-01.jpg","datePublished":"2018-04-13T11:12:47+00:00","dateModified":"2021-12-03T05:05:37+00:00","description":"SAS\/STAT Bayesian Analysis Procure- How to calculate Bayesian Analysis in SAS\/STAT, PROC PHREG, PROC MCMC, PROC LIFEREG, PROC GENMOD, PROC FMM, PROC BCHOICE","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/SAS-STAT-bayesian-analysis-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/SAS-STAT-bayesian-analysis-01.jpg","width":1200,"height":628,"caption":"SAS STAT bayesian analysis"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/stat-bayesian-analysis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Important features of java","item":"https:\/\/data-flair.training\/blogs\/tag\/important-features-of-java\/"},{"@type":"ListItem","position":3,"name":"6 SAS\/STAT Bayesian Analysis Procedures You Must Know"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/13403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=13403"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/13403\/revisions"}],"predecessor-version":[{"id":104690,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/13403\/revisions\/104690"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/13408"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=13403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=13403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=13403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}