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)
a (non-empty) numeric vector of data values.
a vector or factor object giving the group for the corresponding elements of x. The number of levels must equal 2.
the labels of the two groups, if left to NULL, the levels will be used.
the name of the variable to be used in the text.
an optional unit for be appended to the numeric results.
the language to be used. Only english (default) and german implemented (so far).
logical, should NA
s be omitted? Defaults to FALSE
.
a text
# NOT RUN {
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"))
# }
Run the code above in your browser using DataLab