Learn R Programming

tableone (version 0.5.0)

summary.CatTable: Shows all results in a CatTable class object

Description

This method shows all the data a CatTable class object has. This includes the (optionally stratified) part with summary statistics and , if available, p-values from the approximation method test (chisq.test by default) and exact method test (fisher.test by default).

Usage

## S3 method for class 'CatTable':
summary(object, digits = 1, ...)

Arguments

object
An object that has the CatTable class to be shown.
digits
Number of digits to print.
...
For compatibility with generic. Ignored.

Value

  • It will print the results.

See Also

CreateCatTable, print.CatTable, summary.CatTable, CreateContTable, print.ContTable, summary.ContTable, CreateTableOne, print.TableOne, summary.TableOne

Examples

Run this code
## Load
library(tableone)

## Load Mayo Clinic Primary Biliary Cirrhosis Data
library(survival)
data(pbc)
## Check variables
head(pbc)

## Create an overall table for categorical variables
catVars <- c("status","ascites","hepato","spiders","edema","stage")
catTableOverall <- CreateCatTable(vars = catVars, data = pbc)

## Simply typing the object name will invoke the print.CatTable method,
## which will show the sample size, frequencies and percentages.
## For 2-level variables, only the higher level is shown for simplicity.
catTableOverall

## To further examine the variables, use the summary.CatTable method,
## which will show more details.
summary(catTableOverall)

Run the code above in your browser using DataLab