Inspects the correlation between two given features using density scatter plots.
InspectCorrelation(X, Y, DensityEstimation = "SDH",CorMethod = "spearman", na.rm = TRUE,
SampleSize = round(sqrt(5e+08), -3),
NrOfContourLines = 20, Plotter = "native",
DrawTopView = T, xlab, ylab,
main = "Spearman correlation coef.:", xlim, ylim,
Legendlab_ggplot = "value", ...)
plotting handler
Numeric vector [1:n], first feature (for x axis values)
Numeric vector [1:n], second feature (for y axis values)
"SDH" is very fast but maybe not correct, "PDE" is slow but proably more correct.
method of correlation of the cor function, One of "pearson" (default), "kendall", or "spearman
Numeric, positiv scalar, maximum size of the sample used for calculation. High values increase runtime significantly. The default is that no sample is drawn
Function may not work with non finite values. If these cases should be automatically removed, set parameter TRUE
Numeric, number of contour lines to be drawn. 20 by default.
String, name of the plotting backend to use. Possible values are: "native
", "ggplot
", "plotly
"
Boolean, True means contur is drawn, otherwise a 3D plot is drawn. Default: TRUE
String, title of the x axis. Default: "X", see plot()
function
String, title of the y axis. Default: "Y", see plot()
function
string, the same as "main" in plot()
function
see plot()
function
see plot()
function
String, in case of Plotter="ggplot"
label for the legend. Default: "value"
Density specifc parameters, for PDEscatter()
or SDH (nbins,lambda,Xkernels,Ykernel))
Michael Thrun
Example shows that features with high correlation coefficient do not correlate because of bimodality.
[Thrun/Ultsch, 2018] Thrun, M. C., & Ultsch, A. : Effects of the payout system of income taxes to municipalities in Germany, in Papiez, M. & Smiech,, S. (eds.), Proc. 12th Professor Aleksander Zelias International Conference on Modelling and Forecasting of Socio-Economic Phenomena, pp. 533-542, Cracow: Foundation of the Cracow University of Economics, Cracow, Poland, 2018.
DensityScatter
data(ITS)
data(MTY)
Inds=which(ITS<900&MTY<8000)
# \donttest{
InspectCorrelation(ITS[Inds],MTY[Inds])
# }
Run the code above in your browser using DataLab