INRAETableOne: Generate the descriptive statistics table

View source: R/INRAETableOne.R

INRAETableOneR Documentation

Generate the descriptive statistics table

Description

The dependent and independent variable should be indicated as formula format. The formula may contain a dot (".") to refer to "all variables in data other than those that appear elsewhere in the formula". The maximum combination of dependent variables are two, and can be formulated with '+' sign such as 'dependent1' + 'dependent2' ~ 'independent1' + 'independent2' + ....

Also it shows the p-value according to the type of independent variable. The p-value is carefully calculated regarding the number of sample, normality, homogeneity, and independency. The calculation is based on the t.test, wilcox.test, kruskal.test, and anova for continuous variable, whereas chisq.test and fisher.test are used for categorical variable.

Usage

INRAETableOne(x, ...)

## S3 method for class 'formula'
INRAETableOne(
  formula,
  data,
  max.x.level = 5,
  show.missing = FALSE,
  paired = FALSE,
  show.total = FALSE,
  show.detail = FALSE,
  verbose = FALSE,
  digits = 1,
  origData
)

## S3 method for class 'data.frame'
INRAETableOne(x, ...)

Arguments

x

A formula indicating the dependent variable(s) on the left hand side, and the independent variable(s) on the right hand side of '~'.

...

further arguments to be passed to or from methods.

max.x.level

A maximum level of x level. If the level of x level is less than max.x.level, then it consider the column as categorical. The default value is 5

show.missing

A Boolean expression (T/F) whether to show the missing values on the table.

paired

A Boolean expression (T/F) whether to perform a paired test in order to calculate p-value. However, the numbers of sample size at before and after needs to be equal, otherwise, it would perform just two sample t-test.

show.total

A Boolean expression (T/F) whether to show a total group of value.

show.detail

A Boolean expression (T/F) whether to display the other extra summary statistics value such as min, max, and median.

verbose

A Boolean expression (T/F) whether to print the log messages for every step.

digits

A number of decimal digits

Details

It produces a nicely formatted table of descriptive statistics for numeric or categorical variables

Value

An object of class "INRAETableOne".

Methods (by class)

  • formula: The formula interface.

  • data.frame: default S3 method

Examples

## Not run: 
library(INRAETableOne)
data(iris)
INRAETableOne(Species ~ ., iris)

## End(Not run)

parkseeh/INRAETableOne documentation built on April 19, 2022, 1:28 a.m.