library(shiny)
library(htmltools)
div(class = "preface", 
    h4("Preface"),
    "It covers how to aggregate uploaded or stored data.", br(),
    "Describes how to perform summary aggregation and visualization by characteristics of numeric and categorical variables.")


Fuction of Summary Table

In the Summary Table menu, numerical variables are aggregated into statistical tables, and categorical variables are aggregated into frequency tables and contingency tables. And it is visualized to easily understand the distribution of variables.

Statistical Table of Numerical Variables

Create statistical tables of numeric variables and visualize their distributions.

The summary table function is accessed through the menu system of Descriptive Statistics > Summary Table > Statistical Table of Numerical Variables.


Input widget for aggregation


Statistical table by default setting

Here, outputting a statistical table from the Statistical Table of Numerical Variables is assuming that diamonds data is selected in the Dataset: list box.

As the default setting of Descriptive Statistics > Summary Table > Statistical Table of Numerical Variables, if you click the Execute button, the statistical table is output in the right result area.

These default settings are:

Statistical Table of Numeric Variables


Statistical table by user-selected selection

Instead of all numeric variables, the user can select a numeric variable. This example selects the variables caret, depth, table and price.

Widget to select numeric variables

The settings for the statistical table are now defined as follows:

When executed under the above conditions, the following statistical table is output.

Statistical table with selected variables


Statistical table of numeric variables by category

If you check the Calculate by category check box, you can calculate the statistical table of numeric variables for each level of the selected categorical variable.

If you check the Calculate by category check box, a widget called Categorical variables: is displayed. Here you select the categorical variable cut.

Select a list of categorical variables


The settings for the statistical table are now defined as:

When executed under the above conditions, the following statistical table is output.

Statistical table of numeric variables by categorical varables


Statistical table with visualization

Since the statistics table consists of several statistics, it is not easy to understand the distribution of the corresponding numeric variable. However, with visualization, it becomes easier to understand the distribution of numerical variables.

If you check the Plot chart check box, a density plot is output after the statistical table to understand the distribution of numerical variables.

The following is the result when the Plot chart check box is checked. Density plots are visualized for each selected numeric variable along with a statistical table.

Statistical tables and plots


If you check the Plot chart check box and select a categorical variable, a density plot of the numeric variable is created, separated by level of the selected categorical variable.

Statistical table with density plots of numeric variables by level of categorical variables


div(class = "bg-blue", 
    h4(icon("lightbulb", style = "margin-right: 5px;"), 
       "Solution", style = "margin-bottom: 10px; margin-top: 0px;"), 
    "According to the definition of multiple conditions, results from various viewpoints are output on one screen, so it is necessary to learn how to use individual input widgets. If the number of data is small, it runs with the default settings. Then change the condition to see how the result changes.")


Frequency Table of Categorical Variables

Create frequency tables of categorical variables and visualize their distributions.

The frequency table function is accessed through the menu of Descriptive Statistics > Summary Table > Frequency Table of Categorical Variables.


Input widget for frequency table


Frequency table of default settings

As the default setting of Descriptive Statistics > Summary Table > Frequency Table of Categorical Variables, if you click the Execute button, the frequency table is output in the right result area.

The settings for the frequency table are now defined as:

Frequency table for categorical variables


Frequency table with visualization

If you check the Plot chart check box, a bar plot is output after the frequency table to understand the distribution of categorical variables.

The following is the result when the Plot chart check box is checked. Bar plots are visualized for each selected categorical variable along with a frequency table.

Frequency table with visualization


Contingency Table of Categorical Variables

Compute the contingency table of two categorical variables and visualize the distribution.

The contingency table function is accessed through the menu of Descriptive Statistics > Summary Table > Contingency Table of Categorical Variables.


Input widget for contingency table

Contingency table of default selection

As the default setting of Descriptive Statistics > Summary Table > Contingency Table of Categorical Variables, click the Execute button to output contingency table for two categorical variables in the right result area.

The settings for the contingency table are now defined as:

Contingency table for two categorical variables


Contingency table with marginal sum

You can add marginal sums for aggregation of individual rows/columns to a contingency table.

The contingency table executed under the above conditions is output as follows.

Contingency table with marginal sum


Contingency table with visualization

If you check the Plot chart check box, you can output a mosaic plot that can identify the distribution of two categorical variables.

The following is the result when the Plot chart check box is checked. A plot is output to determine the distribution of the two categorical variables output as a contingency table.

Contingency table with visualization



bit2r/BitStat documentation built on Nov. 8, 2022, 4:17 p.m.