Skip to content
Prev 300939 / 398503 Next

contingency tables in R

Your first example creates a four-way table (sex, familyhist, numrisk,
hypertension) and your second example adds four more risk factors. From the
second example, you can use margin.table() to sum across any set of
dimensions and ftable() to present the results of different slices. You
should be able to accomplish what you want without making separate
data.frames.

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352