corrcheck function

Checking correlations for feasibility

Checking correlations for feasibility

The function returns the lower and upper bounds of the correlation coefficients of each pair of discrete variables given their marginal distributions, i.e., returns the range of feasible bivariate correlations.

corrcheck(marginal, support = list(), Spearman = FALSE)

Arguments

  • marginal: a list of kk elements, where kk is the number of variables. The ii-th element of marginal is the vector of the cumulative probabilities defining the marginal distribution of the ii-th component of the multivariate variable. If the ii-th component can take kik_i values, the ii-th element of marginal will contain ki1k_i-1 probabilities (the kik_i-th is obviously 1 and shall not be included).
  • support: a list of kk elements, where kk is the number of variables. The ii-th element of support is the vector containing the ordered values of the support of the ii-th variable. By default, the support of the ii-th variable is 1,2,...,ki1,2,...,k_i
  • Spearman: TRUE if we consider Spearman's correlation, FALSE (default) if we consider Pearson's correlation

Returns

The functions returns a list of two matrices: the former contains the lower bounds, the latter the upper bounds of the feasible pairwise correlations (on the extra-diagonal elements)

Author(s)

Alessandro Barbiero, Pier Alda Ferrari

See Also

contord, ordcont, ordsample

Examples

# four variables k <- 4 # with 2, 3, 4, and 5 categories (Likert scales, by default) kj <- c(2,3,4,5) # and these marginal distributions (set of cumulative probabilities) marginal <- list(0.4, c(0.6,0.9), c(0.1,0.2,0.4), c(0.6,0.7,0.8,0.9)) corrcheck(marginal) # lower and upper bounds for Pearson's rho corrcheck(marginal, Spearman=TRUE) # lower and upper bounds for Spearman's rho # change the supports support <- list(c(0,1), c(1,2,4), c(1,2,3,4), c(0,1,2,5,10)) corrcheck(marginal, support=support) # updated bounds
  • Maintainer: Alessandro Barbiero
  • License: GPL
  • Last published: 2015-09-12

Useful links