Description Usage Note References See Also Examples
The results include sumple number (N), mean, varicance (Var), standard deviation (sd), standard error (se, = sd/sqrt(n)), coefficient of variation (CV, median, median absolute deviation (mad), the first quartile (Q1), the third quartile (Q3), interquartile range (IQR, = Q3-Q1), minimum, maximum, range (Max-Min), corrected sum or squares (CSS), uncorrected sum or squares (USS).
1 | data_summary(x, digits = 3)
|
The basic functions in 'data_summary()' are cited from 'stats' package of R. \n Find more functions in 'DescTools' pacakge, such as Gini Coefficient, Geometric Mean and Standard Deviation, G-Test for Count Data, Skewness and Kurtosis, Confidence Interval for the Mean, Confidence Interval for the Median.
citation("stats")
IQR
, mad
, MeanCI
, MedianCI
, Skew
, Kurt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(R11)
x<-c(1,3,4,6,8,11,13,15,40,50,100)
data_summary(x)
# Not run------------------
shapiro.test(x)
# if p-value>0.05 (i.e. normal distribution), use Mean +/- sd;
# else, use Meadian [Q1-Q3] or Median [IQR].
# Alternatively, mean (95% CI for the mean) and median (95%CI for the median) are also used in some scientific papers.
# In general, 95%CI is not recommended, unless required by the target journal.
library(DescTools)
DescTools::MeanCI(x)
DescTools::MedianCI(x)
# End (Not run)------------
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.