Using SAS, how do I create a Joint Probability Table from this data table
| Undergraduate Major | ||||
| Business | Engineering | Other | Totals | |
| Full Time | 420 | 393 | 77 | 890 |
| Part Time | 399 | 593 | 44 | 1036 |
| Totals | 819 | 986 | 121 | 1926 |
That is a REPORT, not data.
You could make a dataset that has those numbers:
data summary ;
length status $10 Department $20 ;
input status &@ ;
do department='Business','Engineering','Other';
input count @;
output;
end;
cards;
Full Time 420 393 77
Part Time 399 593 44
;
What type of output do you want?
You can make a similar REPORT using PROC FREQ.
proc freq;
tables status*department;
weight count;
run;
The FREQ Procedure
Table of status by Department
status Department
Frequency |
Percent |
Row Pct |
Col Pct |Business|Engineer|Other | Total
| |ing | |
----------+--------+--------+--------+
Full Time | 420 | 393 | 77 | 890
| 21.81 | 20.40 | 4.00 | 46.21
| 47.19 | 44.16 | 8.65 |
| 51.28 | 39.86 | 63.64 |
----------+--------+--------+--------+
Part Time | 399 | 593 | 44 | 1036
| 20.72 | 30.79 | 2.28 | 53.79
| 38.51 | 57.24 | 4.25 |
| 48.72 | 60.14 | 36.36 |
----------+--------+--------+--------+
Total 819 986 121 1926
42.52 51.19 6.28 100.00
That is a REPORT, not data.
You could make a dataset that has those numbers:
data summary ;
length status $10 Department $20 ;
input status &@ ;
do department='Business','Engineering','Other';
input count @;
output;
end;
cards;
Full Time 420 393 77
Part Time 399 593 44
;
What type of output do you want?
You can make a similar REPORT using PROC FREQ.
proc freq;
tables status*department;
weight count;
run;
The FREQ Procedure
Table of status by Department
status Department
Frequency |
Percent |
Row Pct |
Col Pct |Business|Engineer|Other | Total
| |ing | |
----------+--------+--------+--------+
Full Time | 420 | 393 | 77 | 890
| 21.81 | 20.40 | 4.00 | 46.21
| 47.19 | 44.16 | 8.65 |
| 51.28 | 39.86 | 63.64 |
----------+--------+--------+--------+
Part Time | 399 | 593 | 44 | 1036
| 20.72 | 30.79 | 2.28 | 53.79
| 38.51 | 57.24 | 4.25 |
| 48.72 | 60.14 | 36.36 |
----------+--------+--------+--------+
Total 819 986 121 1926
42.52 51.19 6.28 100.00
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.