Learn R Programming

visStatistics

Visualization of the statistical hypothesis test between two groups of categorical or numerical data.

The function visstat() visualizes the statistical hypothesis testing between two groups of data, where varsample is the dependent variable (or response) and varfactor is the independent variable (feature). The statistical hypothesis test with the highest statistical power and fulfilling the assumptions of the corresponding test is performed and visualized. A graph displaying the raw data accordingly to the chosen test as well as the test statistics is generated. Furthermore visstat() returns the corresponding test statistics as text. The automated workflow is especially suited for browser based interfaces to server-based deployments of R. Implemented tests: lm(), t.test(), wilcox.test(), aov(), oneway.test(),kruskal.test(), fisher.test(),chisqu.test().

Installation from GitHub

  1. Firstly, you need to install the devtools package. You can do this from CRAN. Invoke R and then type

install.packages("devtools") 2. Load the devtools package. library(devtools) 3. Install the package from the github- repository install_github("shhschilling/visStatistics") 4. Load the package library(visStatistics) 5. Help on the function usage ?visstat

Examples

Trees data set: Linear regression

visstat(trees,"Girth","Height")

Iris data set: Kruskal-Wallis test

visstat(iris,"Petal.Width", "Species")

InsectSprays data set: ANOVA

visstat(InsectSprays,"count","spray")

InsectSprays data set: Welch two sample t.test

InsectSpraysAB <- InsectSprays[ which(InsectSprays$spray == 'A'| InsectSprays$spray == 'B'), ] #select only sprays 'A und 'B'

InsectSpraysAB$spray = factor(InsectSpraysAB$spray)

visstat(InsectSpraysAB,"count","spray")

ToothGrowth data set: Wilcoxon rank sum test with continuity correction

visstat(ToothGrowth,"len", "supp")

HairEyeColor data set: Pearson's Chi-squared test

HairEyeColorMale = counts_to_cases(as.data.frame(HairEyeColor[,,1]))

visstat(HairEyeColorMale,"Hair","Eye")

Copy Link

Version

Install

install.packages('visStatistics')

Monthly Downloads

134

Version

0.1.1

License

MIT + file LICENSE

Maintainer

Sabine Schilling

Last Published

February 12th, 2021

Functions in visStatistics (0.1.1)

saveGraphVisstat

Saves Graphical Output
colorscheme

colorscheme(x) selects color scheme of graphical output. Function parameter NULL lists all available color schemes, 1 a color tuple of green and blue 2 a color tuple of dark green and turquoi, 3 a colorplaette as defined by RcolorBrewer
visstat

Visualization of statistical hypothesis testing based on decision tree
openGraphCairo

Cairo wrapper function
counts_to_cases

Convert data frame of counts to data frame of cases. data frame must contain a column with frequencies (counts) as generated by as.data.frame from a contingency table
vis_anova_assumptions

Testing ANOVA assumptions
get_samples_fact_inputfile

Selects columns defined by characters varsample and varfactor from a data.frame