demographicTable: Demographic table.

Description Usage Arguments Value Examples

View source: R/demographicTable.R

Description

Produces a table of the distribution of demographic characteristics.

Usage

1
demographicTable(hor_fact, ver_fact, count = TRUE, percent = TRUE, header = TRUE)

Arguments

hor_fact

factor constituting the columns of the table.

ver_fact

factor constituting the rows of the table.

count

logical value that toggles whether to include the absolute values in the table.

percent

logical value that toggles whether to include the values in percent in the table.

header

logical value that toggles whether to include a header for the row factor.

Value

A dataframe constituting the demographic table.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(mydata)

tab.1 <- demographicTable(mydata$sex, mydata$age_group7)
tab.1
tab.2 <- demographicTable(mydata$sex, mydata$age_group7, count=FALSE)
tab.2
tab.3 <- demographicTable(mydata$sex, mydata$age_group7, percent=FALSE)
tab.3

#saveTable(tab.1, "demographicTable.rtf")

psytabs documentation built on May 29, 2017, 10:52 p.m.