BookmarkSubscribeRSS Feed
CristinaAl
Calcite | Level 5

Hi, I'm working on computing two sample test (ttest), I'm VERY new to SAAS.

 

The code I entered below, is not reading or finding the hourlypay column.  What should I do?

 

Thank you for the support!

 

data HourlyPay;
infile '/folders/myfolders/ST513_pay_survey.txt';
input HourlyPay Gender$;
run;
proc print data=hourlyPay;
run;
proc ttest data=heights;
class Gender$;
var HourlyPay;
run;

 

4 REPLIES 4
Reeza
Super User

@CristinaAl wrote:

Hi, I'm working on computing two sample test (ttest), I'm VERY new to SAAS.

 

The code I entered below, is not reading or finding the hourlypay column.  What should I do?

 

Thank you for the support!

 

data HourlyPay;
infile '/folders/myfolders/ST513_pay_survey.txt';
input HourlyPay Gender$;
run;
proc print data=hourlyPay;
run;
proc ttest data=heights;
class Gender$;
var HourlyPay;
run;

 


 

Your input statement needs to reflect the variables in the data set, in the order they appear.

Your dataset has 3 variables, two character one numeric. 

 

Your input statement has two variables listed and not in the same order as your text file.

 

Fix the INPUT statement.

CristinaAl
Calcite | Level 5

Thank you! That makes sense!

ballardw
Super User

Your data contains three fields in apparently gender grade and pay

So when  you use

input HourlyPay Gender$; SAS has been told to read the first column as pay and the second as gender.

 

Try

input gender $ grade $ Hourlypay;

 

In the following code refere to gender only. The $ in the input says "read gender as a character varaible" it is not part of the actual variable name.

CristinaAl
Calcite | Level 5

Balardw!!! THANK YOU!

 

This resolved my issue and it worked!

 

Have a great weekend!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 924 views
  • 0 likes
  • 3 in conversation