DescTools (version 0.99.14)

Desc.logical: Describe a dichotomous variable

Description

Description of a dichotomous variable. This can either be a boolean vector, a factor with two levels or a numeric variable with only two unique values.

Usage

## S3 method for class 'logical':
Desc(x, main = NULL, digits = NULL,
     conf.level = 0.95, plotit = getOption("plotit", FALSE), ...)

Arguments

x
the dichotomous vector to be described.
main
the caption for the output.
digits
integer. With how many digits shoud the relative frequencies be formatted? Default is 3.
conf.level
confidence level of the interval.
plotit
boolean. Should a plot be created? The plot looks like a horizontal bar plot. Default is FALSE.
...
the dots are passed to the table command within Desc.logical.

Value

  • A list containing the following components:
  • lengththe length of the vector (n + NAs).
  • nthe valid entries (NAs are excluded)
  • NAsnumber of NAs
  • uniquenumber of unique values.
  • frqa data.frame of absolute and relative frequencies given by Freq if maxlevels > unique values in the vector.

Details

The confidence levels for the relative frequencies are calculated by BinomCI, method "Wilson" on a confidence level defined by conf.level.

See Also

Desc.factor, Desc.integer, Desc.numeric, Desc.data.frame

Examples

Run this code
Desc(d.pizza$wine_delivered)

Run the code above in your browser using DataCamp Workspace