BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KevinJChristie
Fluorite | Level 6

Hello all, I'm having trouble with proc tabulate.  I need a table that shows mean SEED, TIME, and SPLIT TIME 1 for each STATE by GENDER group, But I also need it to show the number of particpants in each state by gender group. I have the following code:

 

proc tabulate data = q10;
format gender sex_fmt.;
class state gender;
var seed time split1 ;
tables (seed time split1)*mean,state*gender;
run;

 

The format simply takes gender from being 0's and 1's to Male and Female.  That code works just fine and produces a table that meets the first few requirements, but my problem comes in when I try to show the number of participants in each state by gender category.  I've added *n everywhere I can think of and I still get the same error:

 

There are multiple statistics associated with a single table cell in the following nesting :
Split1 * Mean * Gender * N * State.

 

 This is the code that generated that error:

proc tabulate data = q10;
format gender sex_fmt.;
class state gender;
var seed time split1 ;
tables (seed time split1)*mean,state*gender*n;
run;

 

No matter how I arrange the variables it always tells me that I have overlapping data in cells.  What am I missing??????

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
proc tabulate data = q10;
format gender sex_fmt.;
class state gender;
var seed time split1 ;
tables (seed time split1)*(mean N),state*gender;
run;

Does that get you any closer?

View solution in original post

3 REPLIES 3
Reeza
Super User
proc tabulate data = q10;
format gender sex_fmt.;
class state gender;
var seed time split1 ;
tables (seed time split1)*(mean N),state*gender;
run;

Does that get you any closer?

KevinJChristie
Fluorite | Level 6

That works! Its not pretty but it works! thank you.

Reeza
Super User
Yeah, without sample data and a clearer picture of what your table should look like it's harder to help. One little cheat that I do, is use SAS EG for building tables and then steal the proc tabulate code.

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