desc_statby {ggpubr}R Documentation

Descriptive statistics by groups

Description

Computes descriptive statistics by groups for a measure variable.

Usage

desc_statby(data, measure.var, grps, ci = 0.95)

Arguments

data

a data frame.

measure.var

the name of a column containing the variable to be summarized.

grps

a character vector containing grouping variables; e.g.: grps = c("grp1", "grp2")

ci

the percent range of the confidence interval (default is 0.95).

Value

A data frame containing descriptive statistics, such as:

Examples

# Load data
data("ToothGrowth")

# Descriptive statistics
res <- desc_statby(ToothGrowth, measure.var = "len",
   grps = c("dose", "supp"))
head(res[, 1:10])


[Package ggpubr version 0.6.0 Index]