Hi all,
I apologize if this question is already on the forum, but I could not find it. I also apologize for my not perfect English.
I would need to find a way to get a frequency table of several variables (actually the "same variable" spread over several columns), conditioning the result to a category of an additional variable.
Here a dataset example, in wh:
My "final result" should be something like this:
If it is possible, I would like to get the result without creating an additional variable.
Thank you in advance!
I apologize if this question is already on the forum, but I could not find it. I also apologize for my not perfect English.
I would need to find a way to get a frequency table of several variables (actually the "same variable" spread over several columns), conditioning the result to a category of an additional variable.
Here a dataset example, in wh:
| City | Var1 | Var2 | Var3 |
| New York | Eggs | Bread | |
| London | Bread | Eggs | Milk |
| New York | Eggs | Milk | |
| New York | Milk | Eggs | |
| London | Bread | Milk | Egg |
| New York | Milk | Eggs | |
| Paris | Bread | Milk | Eggs |
| London | Milk | Bread | |
| Mumbai | Eggs | Milk | |
| Mumbai | Eggs | Bread |
My "final result" should be something like this:
| New York | New York% | London | London% | Paris | Paris% | Mumbai | Mumbai% | |
| Eggs | 4 | 50.0 | 2 | 25.0 | 1 | 33.3 | 2 | 50.0 |
| Bread | 1 | 12.5 | 3 | 37.5 | 1 | 33.3 | 1 | 25.0 |
| Milk | 3 | 25.0 | 3 | 37.5 | 1 | 33.3 | 1 | 25.0 |
If it is possible, I would like to get the result without creating an additional variable.
Thank you in advance!

Comment