[R] Table multiple answers variables

From: Orvalho Augusto <orvaquim_at_gmail.com>
Date: Tue, 15 Mar 2011 16:13:35 +0200


I have a dataset like this:

   q25_1 q25_2 q25_3 q25_4 q25_5 q25_6 q25_7 q25_8 q25_9 q25_10 q25_11 q25_12

1      2     2     1     1     2     1     2     1     1      2      1      3
2      2     2     2     1     2     1     2     1     1      2      1      2
3      2     1     1     1     2     1     2     1     2      2      1      2
4      2     2     1     1     2     2     2     1     1      1      2      2
5      2     2     1     1     2     3     2     1     2      2      2      2
6      2     2     1     1     2     2     2     1     1      1      2      2
7      2     2     1     1     2     3     2     1     2      2      3      2
8      2     2     1     1     1     1     2     1     1      1      2      2
9      2     2     1     1     2     2     2     1     2      2      2      2
10     2     2     1     1     2     2     2     1     2      1      2      2

where those q25_ variables are answers (coded 1 for Yes 2 for No). Now I need a way to table counting the ones foreach variables like

var        count    percentage
q25_1     20          80
q25_2     34          85

...

Is it possible ir R?

For who used stata might use mrtab.

Thank you
Orvalho

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 15 Mar 2011 - 14:21:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Mar 2011 - 14:40:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive