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

hello, 

I have two distributions A and B as per attached spreadsheet. 

Using Sas stat, which procedure will test they are similar or different?

thanks in advance for your help. 

Qui

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
If you had the raw numbers I'd say PROC FREQ + Chi squared. If you don't I think you can try PROC NPAR1WAY.
You'll need to restructure your data so you have it in one column and another variable identifying your groups.

See this tutorial here to see if matches what you're trying to do:
https://stats.idre.ucla.edu/sas/faq/how-can-i-test-for-equality-of-distribution/

View solution in original post

4 REPLIES 4
Reeza
Super User
If you had the raw numbers I'd say PROC FREQ + Chi squared. If you don't I think you can try PROC NPAR1WAY.
You'll need to restructure your data so you have it in one column and another variable identifying your groups.

See this tutorial here to see if matches what you're trying to do:
https://stats.idre.ucla.edu/sas/faq/how-can-i-test-for-equality-of-distribution/
quiphan
Fluorite | Level 6

Thanks everyone for the suggestions. 

I ended up using proc ttest (paired)  and npar1way to analyse the data. 

Qui

Ksharp
Super User
You could try Kolmogorov-Smirnov test is 0.0164.
This supports rejection of the null hypothesis
that the distributions are the same for the two samples.

Check its Example :
Example 85.2: EDF Statistics and EDF Plot

ods graphics on;
proc npar1way edf plots=edfplot data=Arthritis;
class Treatment;
var Response;
freq Freq;
run;
ods graphics off;

@Rick_SAS wrote a blog about it before .
FreelanceReinh
Jade | Level 19

@Ksharp wrote:
You could try Kolmogorov-Smirnov test is 0.0164.
This supports rejection of the null hypothesis
that the distributions are the same for the two samples.

Check its Example :
Example 85.2: EDF Statistics and EDF Plot

Just to avoid a possible misunderstanding: The p-value 0.0164 refers to the example from the PROC NPAR1WAY documentation, not to @quiphan's sample data. Without knowing anything about the sample sizes, i.e., based on relative frequencies alone, no statistical test can determine whether the differences between the two empirical distributions are significant.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 2163 views
  • 5 likes
  • 4 in conversation