BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mattbot
Calcite | Level 5

Hello,

 

I'm trying to make a two-way frequency table to check if some binary variables I made were made correctly. I had a list of industry codes and I created groups of them via the binary variables. For example, I have a variable NaturalResource if the industry code for any observation is greater than 0170 and less than 0490. I have 21 of these dummy variables and I want to compare the frequencies of the industry code to these variables. When I run 

proc freq data=class.newacsmig2010_2018;
tables IND*Finance*Information*Natresource*utilities*Realestate*accomodation*administrative*construction*educational
entertainment*healthcare*management*manufacturing*military*notworked5yrs*otherservices*profservices 
publicadmin*retail*transportation*wholesale /list; 
run;

I get pretty close to what I want but the problem it only shows the first 9 binary variables on the table that includes the industrial codes, the other 12 get put on their own table which makes it impossible to see what Industry code they are associated with. I've tried outputting to excel but the file just puts the different tables on different sheets instead of combining them. I really just want the first table (in the pictures below) but with all my variables. Thanks in advance for any help.

 

Mattbot_0-1586391590299.png

 

Mattbot_1-1586391642330.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I don't understand your output at all ... this is not a 2-way table, but actually a 22-way table, and I have never seen or heard of anyone doing such a thing. Are you sure that's what you want?

 

But I can see the reason your code gives you this problem where 9 variables on the first table ending with educational.

 

Please look at your code. ID and  the next 9 variables have an asterisk separating the variables. But there is no asterisk after "educational". Therefore ... after variable "educational" you need a .........

 
 
 
--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I don't understand your output at all ... this is not a 2-way table, but actually a 22-way table, and I have never seen or heard of anyone doing such a thing. Are you sure that's what you want?

 

But I can see the reason your code gives you this problem where 9 variables on the first table ending with educational.

 

Please look at your code. ID and  the next 9 variables have an asterisk separating the variables. But there is no asterisk after "educational". Therefore ... after variable "educational" you need a .........

 
 
 
--
Paige Miller
Mattbot
Calcite | Level 5
Yes, it is what I wanted, I'm also missing an asterisk after publicadmin... Thank you

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1054 views
  • 0 likes
  • 2 in conversation