Phrase: Phrasing Results of t-Test

Description Usage Arguments Value Author(s) See Also Examples

View source: R/DescTools.r

Description

Formulating the results of a comparison of means is quite common. This function assembles a descriptive text about the results of a t-test, describing group sizes, means, p-values and confidence intervals.

Usage

1
Phrase(x, g, glabels = NULL, xname = NULL, unit = NULL, lang = "engl", na.rm = FALSE)

Arguments

x

a (non-empty) numeric vector of data values.

g

a vector or factor object giving the group for the corresponding elements of x. The number of levels must equal 2.

glabels

the labels of the two groups, if left to NULL, the levels will be used.

xname

the name of the variable to be used in the text.

unit

an optional unit for be appended to the numeric results.

lang

the language to be used. Only english (default) and german implemented (so far).

na.rm

logical, should NAs be omitted? Defaults to FALSE.

Value

a text

Author(s)

Andri Signorell <andri@signorell.net>

See Also

t.test

Examples

1
2
3
4
5
6
data("cats", package = "MASS")
cat(Phrase(cats$Bwt, cats$Sex, xname="weight", unit="grams", glabels=c("female", "male")))

# oder auf deutsch
cat(Phrase(cats$Bwt, cats$Sex, xname="Geburtsgewicht",
           glabels=c("weiblich", "maennlich"), lang="german"))

DescTools documentation built on June 17, 2021, 5:12 p.m.