A function that returns a description of a continuous variable using the mean together with the standard deviation. The standard deviation is used as it is "industry standard" to use mean with standard deviation and not because it's the only option.
describeMean(
x,
html = TRUE,
digits = 1,
digits.nonzero = NA,
number_first = TRUE,
useNA = c("ifany", "no", "always"),
useNA.digits = digits,
percentage_sign = TRUE,
plusmin_str,
language = "en",
...
)
string
Returns a string formatted for either LaTeX or HTML
The variable that you want the statistics for
If HTML compatible output should be used. If FALSE
it outputs LaTeX formatting
The number of decimals used
The number of decimals used for values that are close to zero
If the number should be given or if the percentage should be presented first. The second is encapsulated in parentheses (). This is only used together with the useNA variable.
This indicates if missing should be added as a separate
row below all other. See table
for useNA
-options.
Note: defaults to ifany and not "no" as table
does.
The number of digits to use for the
missing percentage, defaults to the overall digits
.
If you want to suppress the percentage sign you can set this variable to FALSE. You can also choose something else that the default % if you so wish by setting this variable. Note, this is only used when combined with the missing information.
Provide if you want anything other than the plus minus sign suited for the given output format.
The ISO-639-1 two-letter code for the language of
interest. Currently only english is distinguished from the ISO
format using a ',' as the separator in the txtInt
function.
Passed on to describeFactors
getDescriptionStatsBy
Other descriptive functions:
describeFactors()
,
describeMedian()
,
describeProp()
,
getDescriptionStatsBy()
,
getPvalWilcox()
describeMean(1:10)
describeMean(c(1:10, NA), useNA = "always")
describeMean(c(1:10, NA), useNA = "no")
Run the code above in your browser using DataLab