CHAPTER 7

image

Working with Tables

Tables are very useful for summarizing data. We can use tables for all kinds of data, ranging from nominal to ratio. In Chapter 7, you will learn how to use tables to create frequency distributions and cross-tabulations as well as how to conduct chi-square tests to determine whether the frequencies are distributed according to some null hypothesis.

The table() function in R returns a contingency table, which is an object of class table, an array of integer values indicating the frequency of observations in each cell of the table. For a single vector, this will produce a simple frequency distribution. For two or more ...

Get Beginning R: An Introduction to Statistical Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.