Re: [R] relationship between two factors

From: Greg Snow <Greg.Snow_at_intermountainmail.org>
Date: Thu, 6 Dec 2007 12:05:02 -0700

The 'table' function will give you the simple counts. Plotting a table with the 'plot' function gives common charts for this. The 'CrossTable' function in the gmodels package creates the table along with additional information. There are a lot of other functions for creating/working with tables depending on what you are trying to do.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_intermountainmail.org
(801) 408-8111
 
 


> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of christopher snow
> Sent: Thursday, December 06, 2007 5:51 AM
> To: r-help_at_r-project.org
> Subject: [R] relationship between two factors
>
> I have a dataset with two variables that are factors:
>
> 1) Decision Making Satisfaction (DMS), values = A -
> Completely, B - Mostly, C - Partly, D - Not at all
> 2) IT Satisfaction values (ITS), values = A - Completely, B -
> Mostly, C
> - Partly, D - Not at all
>
> I would like to produce a table (matrix) and a chart of the
> factors, with counts at the cross sections:
>
> A B C D
> A
> B counts
> C
> D
>
> How can I do this in R?
>
> Many thanks,
>
> Chris
>
> --
> This message has been scanned for viruses and dangerous
> content by MailScanner, and is believed to be clean.
>
> ______________________________________________
> 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.
>
______________________________________________ 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 Thu 06 Dec 2007 - 20:23:18 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 Thu 06 Dec 2007 - 20:30:18 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.