Programming the statistical procedures from SAS

Two sample t-test and z-test.

Posts: 0

Two sample t-test and z-test.


I have two samples and I want to test the null hypothesis (mean sample1=mean sample2) using once t-test and then z-test.

For t-test, I use:

proc ttest data=mydata;
var my_variable;
class grouping_variable;

Is it right? the out put is a bit confusing to me. Should I use Pr > |t| or Pr > F to determine the significance of the difference?

Could you please let me know how to run the z-test as well.
Super Contributor
Posts: 281

Re: Two sample t-test and z-test.

Pr>|t| is the t-test you are asking about.

Pr>|F| is the comparison of the variances of the two groups.

It isn't strictly proper to do a z-test on data where the std dev is estimated from the sample.
Trusted Advisor
Posts: 2,114

Re: Two sample t-test and z-test.

To follow-up on Paige's comment, though not strictly proper, the t-distribution converges to the Z-distribution as the sample size goes to infinity so you should reach the same conclusion if the sample size is large.
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation