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 .........
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 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.