Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Bayesian Analysis for pre-post data (one group paired difference)

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 06-28-2019 09:08 PM
(828 views)

Hello All,

Is is it possible to use any SAS procedure for one sample paired difference (pre-post) analysis. That is I want want to compute post minus pre value and the use Bayesian estimate of the mean of this difference. This is like doing pair t-test. I see the SAS documentation for PIOR statement that allows one to model variance component model, but this is different from the Bayesian estimate of pre-post difference. Any help will be appreciated. Bellow is what I have:

proc mixed data=have;

class time (ref="0") subjid;

model diff=/ SOLUTION ;

random subjid;

prior jeffreys/ seed=5235 nmc=20000 out=posterior;

run;

JJ

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Please post few rows of data (if the data is not sensitive) + include an example outcome that you are expecting ... or ... you can try out PROC GENMOD on your own (https://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_genmod_sect...). Not sure if this PROC suits your requirements.

All the best.

All the best.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks. Here is example data.

data have;

input pre post;

datalines;

5.3 3.2

4.4 1.6

6.2 4.2

7.5 3.2

5.1 4.2

3.1 5.3

4.7 8.3

7.3 4.0

;

run;

data have2;

set have;

diff=post-pre;

run;

I want to estimate *"diff"* using Bayesian, if possible.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@SWEETSAS There is definitely a Bayesian form of two sided t-test (https://www.tandfonline.com/doi/abs/10.1198/000313005X55233?journalCode=utas20) However there is a possibility that I am reading the problem wrong here but when you say that you want to estimate "diff" using Bayesian, what do you mean? Is it with respect to some other variable or other distribution? In the absence of any other reference variable (or prior), the calculation of "diff" is exact. Do you want to see if the distribution of diff is coming from some other distribution? I am sorry, I am unable to still comprehend the requirement as I can not see a reference (prior). Please shed some more light (especially what is the primary question you are asking and what kind of solution will be able to answer that question).....

Thank you.

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.