BookmarkSubscribeRSS Feed
marline
Calcite | Level 5

I inserted my data into the SAS, but it is not reading my total number of observations?

sorry, I am a beginner.

what could be the reason?

6 REPLIES 6
marline
Calcite | Level 5
data sickdays;
input days@@;
datalines;

8	10	5	0	6	9	5	15		
5	4	3	2	0	4	15
;
run
;
proc means n mean std stderr clm ; var days;
run;
proc ttest  h0=<9.4; var days ; run;



 
 
ed_sas_member
Meteorite | Level 14

Hi @marline 

 

It seems that the values are separated by a tab.

You can specify it by adding an INFILE statement. Dlm = "09"x means that the delimiter is a tab (not as space or a comma for example).

data sickdays;
	infile datalines dlm="09"x;
	input days @@;
	datalines;
8	10	5	0	6	9	5	15		
5	4	3	2	0	4	15
;
run;
ed_sas_member
Meteorite | Level 14

Hi @marline 

 

I think there is also an issue in the PROC TTEST. Indeed, you can't specify an operator other than equal in H0.

However, you can tell SAS that you conduct an unilateral test by using the SIDE option:

proc ttest data=sickdays h0=9.4 side=u;
	var days;
run;

SIDE = U : Specifies upper one-sided tests, in which the alternative hypothesis indicates a mean greater than the null value

SIDE = L : Specifies lower one-sided tests, in which the alternative hypothesis indicates a mean less than the null value

SIDE = 2 : Bilateral

Hope this helps.

 

Best,

marline
Calcite | Level 5

thanks a lot, I appreciate it but why it read 17 observations while I have 15 ?

marline
Calcite | Level 5

in the note section I get the following: 2 observations are read from your data.

Although all my friends get the result without any problem on their SAS 9.4, is the sas university edition needs a different coding especially in entering the data ?

because I faced the same problem with a set of data copied and pasted from the excel sheet, it was 30 observations and I got only 4 read ?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 6 replies
  • 1170 views
  • 4 likes
  • 3 in conversation