Learn R Programming

sjmisc (version 1.0.0)

mic: Computes a mean inter-item-correlation.

Description

This function calculates a mean inter-item-correlation, i.e. a correlation matrix of data will be computed (unless data is already a cor-object) and the mean of all added item's correlation values is returned. Requires either a data frame or a computed cor-object.

Usage

mic(data, corMethod = "pearson")

Arguments

data
A correlation object, built with the R-cor-function, or a data frame which correlations should be calculated.
corMethod
Indicates the correlation computation method. May be one of "spearman" (default), "pearson" or "kendall".

Value

  • The value of the computed mean inter-item-correlation.

Examples

Run this code
# -------------------------------
# Data from the EUROFAMCARE sample dataset
# -------------------------------
data(efc)
# recveive first item of COPE-index scale
start <- which(colnames(efc)=="c82cop1")
# recveive last item of COPE-index scale
end <- which(colnames(efc)=="c90cop9")
# create data frame with COPE-index scale
df <- as.data.frame(efc[,c(start:end)])

mic(df)

Run the code above in your browser using DataLab