Top "Contingency" questions

A contingency table is a non-negative integer matrix with specified row and column sums.

How do I get a contingency table?

I am trying to create a contingency table from a particular type of data. This would be doable with loops …

r contingency
How to add the total sums to the table and get proportion for each cell in R

I'm trying to get a proportion for each cell by dividing each row by the row sum, but R gives …

r margin contingency
How to create frequency tables with xtabs

> data(infert, package = "datasets") > tt = xtabs(~education + induced + spontaneous, data = infert) > ftable(tt) spontaneous 0 1 2 education induced 0-5…

r tabular contingency
Creating a contingency table using multiple columns in a data frame in R

I have a data frame which looks like this: structure(list(ab = c(0, 1, 1, 1, 1, 0, 0, 0, 1, 1), bc = c(1, 1, 1, 1, 0, 0, 0, 1, 0, 1), de = c(0, 0, 1, 1, 1, 0, 1, 1, 0, 1), cl = c(1, 2, 3, 1, 2, 3, 1, 2, 3, 2)), .Names = …

r contingency