BookmarkSubscribeRSS Feed
SWEETSAS
Obsidian | Level 7

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
koyelghosh
Lapis Lazuli | Level 10
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.
SWEETSAS
Obsidian | Level 7

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.

 

koyelghosh
Lapis Lazuli | Level 10

@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: Save the Date

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

Save the date!

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
  • 3 replies
  • 829 views
  • 0 likes
  • 2 in conversation