calcStats | R Documentation |
calcStats
takes a numeric vector and a factor and runs a preliminary statistical analysis. Output is printed to the screen and the p-value is returned as a character string.
calcStats(
x,
by,
type = c("Wilcox", "Tukey", "T.Test", "ANOVA"),
verbose = FALSE
)
x |
numeric; numeric vector of data points to analyze. |
by |
factor; factor describing the groups within |
type |
character; determines which statistical test should be used. Accepted values are 'wilcox', 't.test', 'ttest', 'anova' and 'tukey'. Values not matching a valid input will produce a warning. |
verbose |
logical; will print statistical output to the screen if set |
This is designed to be used in conjunction with data visualization plots to help with data exploration and should not be used for a robust statistical analysis. Normal distribution, variance and other data characteristics are not evaluated and there is no guarantee that the underling test assumptions are met. For two level factors wilcox.test
or t.test
is recommended. If the factor has more than two levels then pairwise.wilcox.test
and pairwise.t.test
are automatically selected. In this case anova
and the optional follow-up TukeyHSD
can also be used. All output it printed to the console and for the two level tests and anova
the p-value is returned as a text string.
A three element list with the test type, test result object and the p-value as a text string (if available).
wilcox.test
, pairwise.wilcox.test
, t.test
, pairwise.t.test
, anova
, TukeyHSD
data(iris)
#calcStats is not exported but you can invoke it using the calcType options:
test<-niceBox(iris$Sepal.Length, by=iris$Species, calcType="anova", showCalc=TRUE)
test$stats
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.