BookmarkSubscribeRSS Feed
ralphbenno
Fluorite | Level 6

I want to test rate of  "t"  between age 4 and 5

 

proc means data=project mean ;
class sex age ;
var rate  ;

where age in (4 5) & sex in ("t" );
run;

 

"this code shows me the mean for "t" for age 4 and age 5

then I use the ttest  then I get error   did not run


proc ttest data = Project;
class age & sex ;
var rate age;
where  age in (4 5) & sex in ("t");
run;
quit;

run;

 

help help

4 REPLIES 4
ralphbenno
Fluorite | Level 6

sorry the code I used is this

proc means data=project mean ;
class sex age ;
var rate  ;

where age in (4 5) & sex in ("t" );
run;
proc ttest data = Project;
class sex age;
var rate ;
where  age in (4 5) & sex in ("t");
run;
quit;

 

the ttest did not work  prob with "sex" in class

run;

Reeza
Super User

Your title says PROC GLM but you're running PROC TTEST. Which type of test are you trying to run?

If you have a single CLASS variable either procedure gives you the same result. PROC GLM can handle multiple CLASS variables, but unfortunately PROC TTEST cannot. If you need two iterations, you'll have to run it twice. 

 


@ralphbenno wrote:

sorry the code I used is this

proc means data=project mean ;
class sex age ;
var rate  ;

where age in (4 5) & sex in ("t" );
run;
proc ttest data = Project;
class sex age;
var rate ;
where  age in (4 5) & sex in ("t");
run;
quit;

 

the ttest did not work  prob with "sex" in class

run;


 

 

ralphbenno
Fluorite | Level 6

sorry for the confusion

I want to do a t test using multiple class for the column and row

do I use

proc glm

class column, row

var data

 

 

is it right?

PaigeMiller
Diamond | Level 26

It would be very helpful if you provided (a portion of) your data via SAS data step code, and not in any other format.

 

In any event, the general outline of what you want to do is:

 

proc glm data=whatever;
    class x1 x2;
    model y = x1 x2 /* the interaction is optional */ x1*x2;
run;
quit;

 

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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
  • 1935 views
  • 0 likes
  • 3 in conversation