This wrapper is similar to cor_auto
. There
are some minor adjustments that make this function simpler and to
function within EGAnet
. NA
values are not treated
as categories (this behavior differs from cor_auto
)
Arguments
- data
Matrix or data frame. Should consist only of variables to be used in the analysis
- corr
Character (length = 1). The standard correlation method to be used. Defaults to
"pearson"
. Using"pearson"
will compute polychoric, tetrachoric, polyserial, and biserial correlations for categorical and categorical/continuous correlations by default. To obtain"pearson"
correlations regardless, usecor
. Other options of"kendall"
and"spearman"
are provided for completeness and usecor
.cosine
is also available- ordinal.categories
Numeric (length = 1). Up to the number of categories before a variable is considered continuous. Defaults to
7
categories before8
is considered continuous- forcePD
Boolean (length = 1). Whether positive definite matrix should be enforced. Defaults to
TRUE
- na.data
Character (length = 1). How should missing data be handled? Defaults to
"pairwise"
. Available options:"pairwise"
— Computes correlation for all available cases between two variables"listwise"
— Computes correlation for all complete cases in the dataset
- empty.method
Character (length = 1). Method for empty cell correction in
polychoric.matrix
. Defaults to"none"
Available options:"none"
— Adds no value (empty.value = "none"
) to the empirical joint frequency table between two variables"zero"
— Addsempty.value
to the cells with zero in the joint frequency table between two variables"all"
— Addsempty.value
to all in the joint frequency table between two variables
- empty.value
Character (length = 1). Value to add to the joint frequency table cells in
polychoric.matrix
. Defaults to"none"
. Accepts numeric values between 0 and 1 or specific methods:"none"
— Adds no value (0
) to the empirical joint frequency table between two variables"point_five"
— Adds0.5
to the cells defined byempty.method
"one_over"
— Adds1 / n
wheren
equals the number of cells based onempty.method
. Forempty.method = "zero"
,n
equals the number of zero cells
- verbose
Boolean (length = 1). Whether messages should be printed. Defaults to
FALSE
- ...
Not actually used but makes it easier for general functionality in the package