Stacked_Barplot: Interactive Stacked Barplot

Description Usage Arguments Details Author(s) Examples

Description

Takes any data and creates an stacked barplot with multiple interactive features.

Usage

1
Stacked_Barplot(data, n = 10, m = 5, height = c(500, 300))

Arguments

data

A data.frame object that is to be analyzed

n

A numeric value indicating the limit from what number of different values a variable is seen as categorical variable, all variables that have more than n different values are being treated as metric values

m

A numeric value telling hiow many observations need to be in each cell to perform the approximative chi^2-Test, rather than the exact Fisher-Test(default at 5)

height

A two-dimensional numeric value indicating the height of the barplot and boxplot

Details

In the sidebar you can choose two categorical variables and plot a stacked Barplot, each bar conditioned on the first categorical variable. If you click on one of the shown barplots, a boxplot conditioned onto that specifical level of the categorical variable will be shown underneath the barplot. You can also decide which metric variable should be plotted in the boxplot.

@details Eventually the staked barplot describes the frequency table of these two categorical variables. The independence of those variables can be testes ether with a approximate chi^2 test or a exact fisher-test. Which test is used depends on the cell counts in the contigency table and the parameter m, only if at least one cell in the frequency table has less observations than m the exact fisher-test is performed. The test can be interpreted as to weather the hypothesis of independence holds true or not. In case of a 2x2 frequency table the Odds Ratio value is given as well. You can also interactively melt levels of the factorial variable together. In order to do this you at first need to select one level of the factorial variable by clicking on it with a single-click. The chosen boxplot will be highlighted. The other level that you want to melt together with the first one is identified by a double-click. Once you clicked on one level with a single-click and on one level with a double-click, those two levels are melted into one level. The labels on the x-axis are changed accordingly. You can always return to the older version of the factorial variable (with one more level than the current) by pressing the return button.

Author(s)

Cornelius Fritz <cornelius.fritz@campus.lmu.de>

Examples

1
2
3
4
data=mtcars
if (interactive()) {
  Stacked_Barplot(data,n=10,height = c(400,400))
  }

corneliusfritz/intervisu documentation built on May 13, 2019, 10:51 p.m.