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??????
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?
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?
That works! Its not pretty but it works! thank you.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.