BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
LABRADOR
Obsidian | Level 7

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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

 

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

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

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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