In SPSS (relatively), itโs easy to create a cross-tab with multiple variables using coefficients (or values) as the table header. So, something like the following (compiled data, etc.). Q1, Q2 and Q3 each has either 1, 2, or 3 for each person. I just left them as numbers, but they could be factors, and it seems they did not help solve the problem.
1 (very Often) 2 (Rarely) 3 (Never)
Q1. Likes it 12 15 13
Q2. Recommends it 22 11 10
Q3. Used it 22 12 9
In SPSS, you can even query rows, columns, or total percentages.
I tried using table (), ftable (), xtab (), CrossTable () from gmodels and CrossTable () from descr, and none of them can handle (afaik) multiple variables; they basically seem to handle 1 variable crossed with another variable, and the third creates layers.
Is there a package with some good cross tabbing / table examples that I could use to figure this out? I'm sure I missed something simple, so I appreciate that you indicate that I missed. Perhaps I need to generate each line as a separate list, and then make a data frame and print the data?
UPDATE: I opened ctab () in the catspec package, which is also on the right path. Interestingly, R does not have a consistent Ctables equivalent in SPSS, which is basically a tabbing tool ala old tabulation tools used for research. ctab () tries and is a great first step ... but you still can't make this table (above) with it.
r crosstab categorical-data
Michael wexler
source share