BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MR_Xishuai
Calcite | Level 5

Hi guys,

I have a very basic question, but could not find the convincing answer from Interest.

I have two groups with different number of observations.  I have already got the mean and median of the two group and the figure shows group A is larger than group B. But I do not know whether these are significant or not. So I want to do the univariate test to look at whether they have the same mean and same median. According to papers, the basic steps is to do t-test for mean and Wilcoxon test for median. But I have several questions regarding this:

1. Shall I use the one-sided t-test or two-sided t-test? What I did is using the coed below:

Proc ttest data=;

  class ;

  var ;

run;

Will this give me the one-sided t-test or two-sided t-test? And what is the common practice in the paper when they show whether the two group has different mean? one-sided or two-sided?

2. About the Wilcoxon test to test whether they have same median, shall I use Wilcoxon rank-sum test or Wilcoxon signed-rank test? I did see both but I do not know which to use.

And also when I read the result from SAS, shall I use the one-sided result or two-sided? I used the following code:

proc npar1way data = wilcoxon;

  class;

  var ;

run;

I really do not know which is the right way. I really appreciate your help. Cheers.

1 ACCEPTED SOLUTION

Accepted Solutions
Doc_Duke
Rhodochrosite | Level 12

The Wilcoxon rank-sum test (also known as the Mann-Whitney test) is the test for basic comparison of two groups for difference in the median.  It assumes that the data are measured in the interval or ratio scale. 

The Wilcoxon signed-rank test is a one sample test that the median is a constant (typically 0, as it is often used for difference scores).

View solution in original post

3 REPLIES 3
Reeza
Super User

Re One sided/Two Sided P-Value

If your hypothesis is that

H0: X1=X2

H1: X1>X2 or (X1<X2)

then you use a one sided p-value.

If your hypothesis is:

H0: X1=X2

H1: X1 ne X2

then you use a two sided p-value.

I can't say which test you should use, but I highly recommend graphing your data, via box plot or violin plot to examine the distributions as well as testing.

Ksharp
Super User

Bivariable Normal Distribution for TTEST, otherwise for Wilcoxon .

Doc_Duke
Rhodochrosite | Level 12

The Wilcoxon rank-sum test (also known as the Mann-Whitney test) is the test for basic comparison of two groups for difference in the median.  It assumes that the data are measured in the interval or ratio scale. 

The Wilcoxon signed-rank test is a one sample test that the median is a constant (typically 0, as it is often used for difference scores).

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 5505 views
  • 0 likes
  • 4 in conversation