get_cronbach {COINr} | R Documentation |
Cronbach's alpha
Description
Calculates Cronbach's alpha, a measure of statistical reliability. Cronbach's alpha is a simple measure
of "consistency" of a data set, where a high value implies higher reliability/consistency. The
selection of indicators via get_data()
allows to calculate the measure on any group of
indicators or aggregates.
Usage
get_cronbach(coin, dset, iCodes, Level, ..., use = "pairwise.complete.obs")
Arguments
coin |
A coin or a data frame containing only numerical columns of data. |
dset |
The name of the data set to apply the function to, which should be accessible in |
iCodes |
Indicator codes to retrieve. If |
Level |
The level in the hierarchy to extract data from. See |
... |
Further arguments passed to |
use |
Argument to pass to stats::cor to calculate the covariance matrix. Default |
Details
This function simply returns Cronbach's alpha. If you want a lot more details on reliability, the 'psych' package has a much more detailed analysis.
This function replaces the now-defunct getCronbach()
from COINr < v1.0.
Value
Cronbach alpha as a numerical value.
Examples
# build example coin
coin <- build_example_coin(up_to = "new_coin", quietly = TRUE)
# Cronbach's alpha for the "P2P" group
get_cronbach(coin, dset = "Raw", iCodes = "P2P", Level = 1)