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.
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 .........
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 .........
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.