Solved
Contributor
Posts: 37

# How can I make a table like this?

[ Edited ]

I'm tryng to make a table that looks like this:

 Education Sex FrequencyCol Pct FEMALE MALE Total N % N % N % No formal schooling 0 0 4 2.31 4 155 Grade 8 or less 0 0 9 5.2 9 3.49 Some high school 5 5.88 31 17.92 36 13.95 High school graduate 12 14.12 43 24.86 55 21.32 Some trade school/technical, college or university 17 20 31 17.92 48 18.6 Trade school/technical training program graduate 6 7.06 24 13.87 30 11.63 Community college graduate 24 28.24 18 10.4 42 16.28 University Graduate 21 24.71 13 7.51 34 13.18 Total 85 100% 173 100 258 100

But I can't seem to actually get it to look like this. I've been able to get the data I need by using this code:

```proc freq data=demo_combined_final;
tables program*ca_education*gender/norow;
format ca_education education.;
label gender='Gender'
ca_education='Education'
program='Program';
run;```

But it's time consuming to have to reformat everything.

Does anyone know if it's possible to make a table like the above?

the female and male headings should go across the "N" and the "%" headings in the first 4 columns

Accepted Solutions
Solution
‎12-13-2016 10:59 AM
Super User
Posts: 13,577

## Re: How can I make a table like this?

Posted in reply to confused_saser

You don't show how program fits but this may get you started with a different report procedure:

```proc tabulate data=demo_combined_final;
class ca_education  gender;
tables ca_education All='Total',
(gender All='Total') *(n colpctn)
;
format ca_education education.;
label gender='Gender'
ca_education='Education'
program='Program';
run;```

Procs Report and Tabulate come into play when you need more than Freq provides. They will also do statistics such as Proc means such as max, min, mean, standard deviation and others.

All Replies
Solution
‎12-13-2016 10:59 AM
Super User
Posts: 13,577

## Re: How can I make a table like this?

Posted in reply to confused_saser

You don't show how program fits but this may get you started with a different report procedure:

```proc tabulate data=demo_combined_final;
class ca_education  gender;
tables ca_education All='Total',
(gender All='Total') *(n colpctn)
;
format ca_education education.;
label gender='Gender'
ca_education='Education'
program='Program';
run;```

Procs Report and Tabulate come into play when you need more than Freq provides. They will also do statistics such as Proc means such as max, min, mean, standard deviation and others.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
• 1 reply
• 158 views
• 1 like
• 2 in conversation