I have data which looks like following. I was wondering how to run a t-test when variables that I want to compare are in different columns
+---------+------------+----------+-------------+-------------+----------------+
| Case_id | Control_id | case_age | control_age | case_result | control_result |
+---------+------------+----------+-------------+-------------+----------------+
| 1 | 50 | 24 | 24 | 23 | 12 |
| 1 | 52 | 24 | 24 | 23 | 10 |
| 2 | 65 | 27 | 27 | 24 | 15 |
| 2 | 70 | 27 | 27 | 24 | 14 |
+---------+------------+----------+-------------+-------------+----------------+
The SAS tutorials indicate the following syntax for running a t-test. But in my case I do not have a class variable to distinguish between cases and control. Is there a way to tell SAS to compare two variables case_result
and control_result
.
proc ttest data;
class Gender;
var Score;
run;