BookmarkSubscribeRSS Feed
Lacona
Quartz | Level 8

Hey all,

My dataset consists of two variables, one categorical (survived/perished) one numerical (lengths of bone).
n (perished) = 24, n(survived) = 35, alpha=0.01 (for 99%CL).
It is asked for the critical value of survived and critical value of perished. The critical value is t (DF, alpha/2).
Table give me: t(23,0.005) = 2.8, t(34,0.005)~2.72


Now I tried to get the critical values in SAS and it worked out perfectly for the perished ones:

data perished;
set humerus;
if status='Perished';
run;

data perished;
tp=tinv (0.995,23);
run;

proc print data=perished;
run;

However, it didn't work out for the survived group and I can't figure out, why:

data survived;
set humerus;
if status='Survived';
run;

data survived;
ts=tinv (0.995;34);
run;

proc print data=survived;
run;

Log:

73         data survived;
 74         ts=tinv (0.995;34);
                          _
                          79
               ____        __
               71          180
 ERROR 79-322: Expecting a ).
 
 ERROR 71-185: The TINV function call does not have enough arguments.
 
 ERROR 180-322: Statement is not valid or it is used out of proper order.
 
 75         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.SURVIVED may be incomplete.  When this step was stopped there were 0 observations and 1 variables.
 WARNING: Datei WORK.SURVIVED wurde nicht ersetzt, da da dieser Schritt angehalten wurde.
 NOTE:  Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
       real time           0.01 seconds
       cpu time            0.00 seconds
             

Any ideas?!

2 REPLIES 2
Reeza
Super User

You accidentally put a semicolon instead of a comma. 

Compare the two lines of code and notice the difference. And note where SAS has flagged.

 


@Lacona wrote:

Hey all,

My dataset consists of two variables, one categorical (survived/perished) one numerical (lengths of bone).
n (perished) = 24, n(survived) = 35, alpha=0.01 (for 99%CL).
It is asked for the critical value of survived and critical value of perished. The critical value is t (DF, alpha/2).
Table give me: t(23,0.005) = 2.8, t(34,0.005)~2.72


Now I tried to get the critical values in SAS and it worked out perfectly for the perished ones:

data perished;
set humerus;
if status='Perished';
run;

data perished;
tp=tinv (0.995,23);
run;

proc print data=perished;
run;

However, it didn't work out for the survived group and I can't figure out, why:

data survived;
set humerus;
if status='Survived';
run;

data survived;
ts=tinv (0.995;34);
run;

proc print data=survived;
run;

Log:

73         data survived;
 74         ts=tinv (0.995;34);
                          _
                          79
               ____        __
               71          180
 ERROR 79-322: Expecting a ).
 
 ERROR 71-185: The TINV function call does not have enough arguments.
 
 ERROR 180-322: Statement is not valid or it is used out of proper order.
 
 75         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.SURVIVED may be incomplete.  When this step was stopped there were 0 observations and 1 variables.
 WARNING: Datei WORK.SURVIVED wurde nicht ersetzt, da da dieser Schritt angehalten wurde.
 NOTE:  Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
       real time           0.01 seconds
       cpu time            0.00 seconds
             

Any ideas?!


 

Lacona
Quartz | Level 8

Oh no.... 
sometimes it is so simple to solve a big problem!

Thank you so much!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 1376 views
  • 0 likes
  • 2 in conversation