library(shiny) library(htmltools)
div(class = "preface", h4("Preface"), "Analyze the correlation of numeric variables.", br(), "'Correlation' calculates the correlation matrix, visualizes the correlation matrix, and helps to easily understand the relationship of variables with correlation tests and correlation plots of two variables.")
In the Correlation
menu, correlation matrix of numerical variables and correlation test of two numerical variables are performed and a scatter plot is visualized.
Create correlation matrix of numeric variables and visualize correlation matrix plot.
The correlation matrix function is accessed through the menu system of Descriptive Statistics > Correlation > Correlation Matrix.
All
and Custom
with the radio button.Numerical Variables(Choose two or more):
will appear.User choose
is specified in Target variable selection type:
.Pearson's r statistic
, Kendall's tau statistic
, Spearman's rho statistic
.Pearson's r statistic
is selected by default.correlation matrix plot
together with the correlation matrix.The method of outputting the correlation matrix from the Correlation Matrix
is introduced on the premise of selecting the 'diamonds' data from the Dataset:
list box.
As the default setting of Descriptive Statistics > Correlation > Correlation Matrix, if you click the Execute
button, the Correlation Matrix is output in the right result area.
These default settings are:
Pearson's r statistic
Instead of all numeric variables, the user can select a numeric variable to be output. This example selects two variables caret
and table
.
The settings for the correlation matrix are defined as follows.
caret
, table
If executed under the above conditions, the following correlation matrix is output.
If you check the 'Calculate by category' check box, you can calculate the correlation matrix of the numeric variable for each level of the selected categorical variable.
Select the categorical variable cut
from the Categorical variables:
that appears by checking the Calculate by category
check box as shown in the following figure.
The settings for the correlation matrix are defined as follows.
caret
, table
cut
When executed under the above conditions, the following aggregate correlation matrix is output.
A correlation matrix is a matrix structure of statistics composed of a combination of several numeric variables. Visualizing this structure makes it easier to understand the relationship between variables.
If you check the Plot chart
check box, you can output a correlation matrix plot
that can identify the relationship between numeric variables.
The following is the result when the Plot chart
check box is checked. A plot similar to the composition printed on the correlation matrix is output.
A correlation test of two numerical variables is performed, and the relationship between the two variables is visualized based on a scatterplot.
The correlation test function is accessed through the menu system of Descriptive Statistics > Correlation > Correlation Test.
Pearson's r statistic
, Kendall's tau statistic
, Spearman's rho statistic
.Pearson's r statistic
is selected by default.Correlation Coefficient ≠ 0
, Correlation Coefficient < 0
, Correlation Coefficient > 0
.Correlation Coefficient ≠ 0
is selected by default. Categorical variables:
for categorical calculations.If you click the Execute
button as the default setting of Descriptive Statistics > Correlation > Correlation Test, correlation test result will be displayed in the right result area.
These default settings are:
caret
, table
Pearson's r statistic
Correlation Coefficient ≠ 0
If the Calculation by category
check box is checked, the correlation test of two numerical variables is performed for each level of the selected categorical variable.
Select the categorical variable cut
from the Categorical variables:
that appears by checking the Calculate by category
check box as shown in the following figure.
The settings for the correlation test were defined as follows.
caret
, table
Pearson's r statistic
Correlation Coefficient ≠ 0
cut
If it is executed under the above conditions, the following correlation test result is output.
If you check the Plot chart
check box, a scatter plot
is output to determine the relationship between two numerical variables along with the correlation test result.
The following is the result when the Plot chart
check box is checked.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.