Phrase | R Documentation |
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.
Phrase(x, g, glabels = NULL, xname = NULL, unit = NULL, lang = "engl", na.rm = FALSE)
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 |
a text
Andri Signorell <andri@signorell.net>
t.test
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.