Description Usage Arguments Details Author(s) See Also Examples
summ.by
generates seven number summary statistics and tests normality
on the fly grouped by a categorical variable.
1 2 3 4 5 6 7 |
x |
a numeric object |
y |
a factor or character object |
data |
a data frame object (Optional) |
rnd |
specify rounding of numbers. See |
na.rm |
A logical value to specify missing values, <NA> in the table |
print.table |
logical value to display formatted outputs |
Similar to summ
output, summBy
reports number of observations in the dataset, missing data, seven number
summary statistics, coefficient of variation (CV.) and normality test.
Normality test is perfomed by Shapiro-Wilk Normality Test. See more at
shapiro.test
.
ANNOTATIONS
Obs. = observation
NA. = missing data
Mean = Mean value
Std.Dev = Standard deviation
Median = Median value
Q1 = First quartile or percentile
Q3 = Third quartile or percentile
Min = Minimum value
Max = Maximum value
Normal.test = test by Shapiro-Wilk Normality Test
If the second variable has two levels of category, it performs either
Student's t-test
t.test
or Wilcoxon test (Mann-Whitney's test)
wilcox.test
. If more than two levels, ANOVA
aov
or
Kruskal-Wallis rank sum test kruskal.test
is carried out to test the difference between different groups.
Myo Minn Oo (Email: dr.myominnoo@gmail.com | Website: https://myominnoo.github.io/)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
# single x variable
summBy(age, education, infert)
summBy(infert$age, infert$education)
# multiple variables
summBy(c(age, parity, stratum), education, infert)
# whole dataframe
summBy(infert, education)
summBy(iris, Species)
# variables labels
infert.new <- labelVars(infert,
c(age, case, spontaneous, education),
c("age of patient",
"case (yes or no)",
"spontaneous labor",
"education of patient"))
infert.new <- keep(infert.new, age, case, spontaneous, education)
codebook(infert.new)
summBy(infert.new, education)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.