How would I be able to take the frequencies in matrix. For the data I am using I have colums A, B, C, D, E., however, they do not represent different variables, so I do not want to know the frequency of each unique entry per column, but rather, the frequency of each unique entry for the matrix as a whole.
Attatched is the matix.
Best,
Yes. It is IML thing. data have; input a b c d e; cards; 1 2 3 6 2 3 4 7 1 . 2 . . 3 6 ; run; proc iml; use have; read all var{a b c d e} into x; close; call tabulate(level,freq,x); print (level`)[l='level'] (freq`)[l='freq']; quit;
And the output should look like what for that example data?
It isn't clear if you are looking for an overall frequency from the entire dataset or per row only.
Also are those the only values that will ever appear among the variables or do you have the possibility of practically unlimited actual values for A B C D and E?
Since you are using the word "matrix" this might be better as a SAS/IML question.
I want to take the frequency if the whole dataset and I do not want the output to give me the out put based on A B C D E. They mean nothing for my data.
Yes. It is IML thing. data have; input a b c d e; cards; 1 2 3 6 2 3 4 7 1 . 2 . . 3 6 ; run; proc iml; use have; read all var{a b c d e} into x; close; call tabulate(level,freq,x); print (level`)[l='level'] (freq`)[l='freq']; quit;
Thanks for your help! It worked!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.