From the course: SAS Essential Training: 1 Descriptive Analysis for Healthcare Research

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Conducting t-tests

Conducting t-tests - SAS Tutorial

From the course: SAS Essential Training: 1 Descriptive Analysis for Healthcare Research

Start my 1-month free trial

Conducting t-tests

- [Instructor] Before we do our t-test, let's start by opening exercise file Continuous_Desc Tbl_V2_Complete without tests. We will put our t-test results in here. Obviously, no test go here on the all row so we'll put NA for Not Applicable. Okay, now remember statistics 101? You can only do a t-test if you have a two-level categorical variable like this one, diabetes status. You can t-test the mean hours of sleep per night between diabetics and non-diabetics. Those are our two groups. Let's go to SAS and t-test these groups. And our code is in the exercise files and is named 320_T-tests. And can you guess the name of the PROC we will use? Probably, it's proc ttest. You'll see here we specify the data set which is still analytic, but here's an important new thing, the class statement. This class statement says the name of your two-level categorical variable which is DIABETE4 for us. And we follow it up with var SLEPTIM1 and then run. Let's highlight and run this and see what happens…

Contents