Programming the statistical procedures from SAS

Using proc ttest

Reply
N/A
Posts: 1

Using proc ttest

Suppose we have variables ID X Y and our data looks like this:

003 42 34

004 54 65

005 33 46

. . .

I want to perform a paired and unpaired t-test on the X and Y variables without a data step (this is part of the question).. I understand

how to do a paired, but how can you do an unpaired t-test, as in X and Y are just different sets of sample data? es

Respected Advisor
Posts: 4,606

Re: Using proc ttest

Proc Transpose...; by id; var x y; run; ? Then proc ttest...; class _NAME_; var col1; run;

PG
Grand Advisor
Posts: 16,875

Re: Using proc ttest

You need to transform your data so that you have your variables stacked and a new variable that identifies the groups:

ID Var Value

1 X 1

1 Y 2

1 X 3

1 Y 4

Ask a Question
Discussion stats
  • 2 replies
  • 238 views
  • 0 likes
  • 3 in conversation