Hi everyone, I am needing some help creating a custom percentage in proc tabulate. Using sas 9.4. New here so will do my best to describe and please let me know how I can clarify. I am using record level data with the following columns: individual's id#, year of birth, group#, ethnicity, Degree, Grads. Degree is categorial- as either MA or BA (I created this based on numerical values I had and could pull in the numerical values if needed- as the grade number completed) Heres what I am working with and some of a small portion of the data: data graduation; input ID Year Group$ ethnicity degree$ grads; cards; 1 1995 A 1 MA 1 2 1995 B 2 BA 1 3 1995 A 3 MA 1 4 1995 A 1 MA 1 5 1995 A 3 BA 1 6 1995 C 2 BA 1 7 1995 A 2 BA 1 8 1995 B 1 MA 1 9 1995 B 1 MA 1 10 1995 A 1 BA 1 11 1995 B 3 BA 1 12 1995 A 3 BA 1 13 1995 A 3 BA 1 14 1995 B 2 MA 1 15 1995 C 1 BA 1 16 1995 A 2 BA 1 17 1995 A 3 BA 1 18 1995 A 2 MA 1 19 1995 A 2 MA 1 20 1995 A 2 MA 1 21 1995 A 3 BA 1 22 1995 B 2 MA 1 23 1995 C 1 BA 1 24 1995 C 2 BA 1 25 1995 B 3 BA 1 26 1995 C 1 BA 1 27 1995 B 2 BA 1 28 1995 B 2 BA 1 ; proc format; value ethn 1= 'White' 2= 'Black' 3= 'Hispanic' ; run; proc tabulate data= graduation ; class group ethnicity degree; var grads; table group, ethnicity*(degree*(n pctn<grads>) grads); format ethnicity ethn.; run; Below is the table i'm getting. This is the format I want. But the percents are not correct since you can see they are all 100. Instead, I would like the percent as the number with MA degree out of the Grads sum, within each ethnicity, and similarly for BA. For example in the highlighted, it should be (16*100)/70. I have tried to do colpctn and rowpctn but have been unsuccessful. Thanks in advance.
... View more