In SPSS, it is (relatively) easy to create a cross tab with multiple variables using the factors (or values) as the table heading. So, something like the following (made up dat
xtabs
has a formula interface that can take some practice to get used to, but this can be done. If you have the data in a dataframe df
and your variables are called ques
and resp
, you can use:
xtabs(~ques+resp,data=df)
For example:
> t1 <- rep(c("A","B","C"),5)
> t2 <- rpois(15,4)
> df <- data.frame(ques=t1,resp=t2)
> xtabs(~ques+resp,data=df)
resp
names 2 3 4 5 6 7 9
A 1 0 2 1 0 0 1
B 1 0 0 2 1 1 0
C 1 2 0 1 0 1 0