Programming the statistical procedures from SAS

different results in proc mcmc and proc model

New Contributor
Posts: 2

different results in proc mcmc and proc model

the example "simple linear regression" on page 3480 in sas documentation.

estimate of sigma2 in proc mcmc is 136.8,but my estimate of sigma2 is 112.7 in proc model  using maximum likelihodd method .

what's the problem.thanks for answering.

the code of proc model:

PROC model data=sasuser.class;

dependent weight;

parm a b sig2;


errormodel weight~normal(sig2);

fit weight/method=marquardt;


New Contributor
Posts: 2

Re: different results in proc mcmc and proc model

I just validated the analytic solution of MLE of sigma2,and got 112.7 too.

Valued Guide
Valued Guide
Posts: 684

Re: different results in proc mcmc and proc model

Not sure why you have this question. MCMC is a Bayesian procedure, and one does not expect to get the same results with Bayesian estimation as with MLE (or REML). With noninformative priors, you often get similar results, but not the same. You did not give the code for MCMC, so we cannot check if your program is correct.  For your information, there are multiple versions of the SAS User's Guide, so it does not help to give a page number. You should give a chapter name and section/sub-section heading (or example number from the chapter).

Respected Advisor
Posts: 2,655

Re: different results in proc mcmc and proc model

Following on to lvm's comment:

The interval estimate from MCMC certainly contains the MLE estimate of sigma2, so the fact that the point estimates differ is really not relevant, given that entirely different algorithms are employed to derive the estimates.

I used your code for PROC MODEL and obtained the code for PROC MCMC from the online section Getting Started: MCMC Procedure - Simple Linear Regression. My variance estimate from MCMC was 137.3, slightly different from yours, and not wholly unexpected given differences in platforms, etc.  I did duplicate your PROC MODEL output.  However, I could not easily get a confidence interval for sigma2 from PROC MODEL, which would have made my point clearer.  The credible intervals from MCMC for the other parameters look quite similar to the confidence intervals obtained from PROC MODEL.

Steve Denham

Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation