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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.