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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1246 views
  • 4 likes
  • 3 in conversation