Table {GMDH2} | R Documentation |
Table for Simple Descriptive Statistics
Description
Table
produces a table for simple descriptive statistics for a binary response.
Usage
Table(x, y, option = "min-max", percentages = "column", ndigits = c(2,1),
output = "R")
Arguments
x |
a data frame including all variables. |
y |
a factor of binary response variable. |
option |
an option to return "min-max" or "Q1-Q3". Default is set to "min-max". |
percentages |
a character string to select the desired percentages. To use column or row percentages, percentages should be set to "column" or "row", respectively. The percentages argument is set to "total" to obtain total percentages. Default is set to "column". |
ndigits |
a vector of two numbers. The first one is used to specify the number of digit for numeric/integer variables. The second one specifies the number of digits for percentages of factor/ordered variables. Default is set to ndigits = c(2,1). |
output |
a character string to specify the format of descriptive statistics. If output = "LaTeX", it returns the table as latex format. If output = "HTML", it produces the table as html format. If output = "R", it returns the table in R console. |
Author(s)
Osman Dag
Examples
library(GMDH2)
library(mlbench)
data(BreastCancer)
data <- BreastCancer
# to obtain complete observations
completeObs <- complete.cases(data)
data <- data[completeObs,]
x <- data[,2:10]
y <- data[,11]
Table(x, y)
Table(x, y, output = "LaTeX")