0% found this document useful (0 votes)
9 views4 pages

SAS Studio 05 Two Sample Tests - 06.28

Uploaded by

Vinod Krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

SAS Studio 05 Two Sample Tests - 06.28

Uploaded by

Vinod Krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

SAS Studio Exercise 05

Two Sample T-Test

(11/22/2024)

Sources
Steve Nolan, Ron Freeze, Elizabeth Keiffer, Michael Gibbs, Jorge Moreda, Shubhashree Sahoo
Enterprise Systems, Sam M. Walton College of Business, University of Arkansas, Fayetteville
SAS® Studio. Release 5.2
SAS® VIYA® release V.03.05

Copyright © 2018 For educational uses only - adapted from sources with permission. No part of this
publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means,
electronic, mechanical, photocopying, or otherwise, without the prior written permission from the
author/presenter.
Use Case – One Sample T-Test
Razorback Stores is a local department store serving a metropolitan area. As a department store, they
offer a wide variety of items and services and track sales through a point of sale system. Over the past
several months, Razorback Stores performed a marketing campaign designed to promote and incentivize
a loyalty program.
As a recent hire, your boss has asked you to analyze the following:
 Is there a difference between the type of customer (Regular – Promotional) and the amount of
money (Net Sales) they spend in the store?

Step 0: Navigate to SAS Studio/Activate CAS Session


Before jumping into the t-Test task, please refer to SAS Studio 01 – Logging into the System to
understand how to navigate to SAS Studio, activate a CAS session, and manage your data.
We will be using the Razorback Stores dataset which will be provided by your instructor and/or is
available on blackboard. Once you have this dataset loaded on SAS Viya, following SAS Studio 01 –
Logging into the System tutorial, load this dataset into memory in your personal user folder.

Step 1: Tasks
In order to access the t-Tests task within SAS Studio:
1. Click on the Tasks icon located on the left-panel
2. Expand the SAS Tasks folder
3. Expand the Statistics folder
4. Expand the Descriptive folder
5. Find t Tests and double click on it

Step 2: Select Data


Next, you need to select your data. In this case, we will be choosing Razorback Stores which can be
found in our User folder. Under DATA,
6. Click on the folder icon located at the right of the current dataset in place.
A new Choose a Table window will open,
7. Click on Libraries
8. Click on MYCASLIB which
references your User folder
All the different datasets found in your User
folder will display on the right.
9. Select RAZORBACK_STORES
10. Click OK
3

Step 3: Select Variables


Once you have Razorback Stores dataset selected, we need to change our test to a two-sample t test and
select the variables we want to work with. Notice the red font color text at the bottom. It requires you to
select exactly one Analysis variable.
Under t-Test:,
11. Select Two-Sample test from the dropdown menu
Notice that you have now three subtitles under ROLES:
a. t-Test: choose what type of t-Test you are performing. For this tutorial: Two-Sample test
b. Analysis variable: what you want to observe/analyze/test: Net Sales.
c. Group variable: what are your independent variables. For this tutorial: Type of Customer
Under Analysis variable:,
12. Click on the + sign
A new window will open,
13. Select Net Sales
14. Click OK
Under Groups variable:,
15. Click on the + sign
In the new window that opened,
16. Select Type of
Customer
17. Click OK
Note that once you have set
both analysis variable and group variables, the red text that required you to insert variables disappeared
and code is automatically created to the right.

Step 4: Modify Settings


Once you have selected your dataset and variables, you can move to the OPTIONS tab where you can
modify settings such as the type of test you want to perform and the alternative hypothesis value you are
testing for.
18. Click on the OPTIONS tab
Under TESTS you will find four settings you can change:
a. Tails
b. Alternative Hypothesis: mu^ =
c. Normality Assumption
d. Nonparametric Tests
For Tails:,
19. Select Two-tailed test from the dropdown menu
Keep the other settings as default.
Notice that as we have selected a dataset, variables, and checked/unchecked settings, there is a code area
on the right side of the screen that has been updating as we modified these.
20. Click Run

Step 5: Results
Once the task has executed, you will have your t-Test results view in the right most pane.
In order to better visualize the results, locate the three dots at the very right
end of the screen under the current date and time.
21. Click on these three dots and,
22. Click on Open in a browser tab
23. Click on Results
We see following tables and charts:
Statistics Table:

Confidence Limits Table:

T-Tests Table:

Equality of Variances Table:

Summary Panel Visual:

Q-Q Plot Visual:

Using this information (e.g. T-value, P-value, and Q-Q Plot of our variable), we can accept or reject our
null hypothesis.
You can also click on the Maximize preview icon to see a clear view of
Results

Congratulations, you have successfully performed a two-sample t-test in SAS Studio!

You might also like