| reliability | R Documentation |
Computes internal consistency reliability estimates for a single-factor scale, including Cronbach’s alpha, McDonald’s omega (total), and optional ordinal (polychoric-based) variants. Confidence intervals may be obtained via nonparametric bootstrap.
reliability(
data,
include = "none",
ci = FALSE,
ci_level = 0.95,
n_boot = 1000,
na_method = c("pairwise", "listwise"),
min_count = 2,
digits = 3,
verbose = TRUE
)
data |
A data frame or matrix containing item responses. Each column represents one item; rows represent respondents. |
include |
Character vector specifying which additional estimates to compute. Possible values are:
Multiple options may be supplied. |
ci |
Logical; if |
ci_level |
Confidence level for bootstrap intervals.
Default is |
n_boot |
Number of bootstrap resamples used when |
na_method |
Method for handling missing values. Either
|
min_count |
Minimum observed frequency per response category required
to attempt polychoric correlations. Ordinal reliability estimates are
skipped if this condition is violated. Default is |
digits |
Number of decimal places used when printing estimates.
Default is |
verbose |
Logical; if |
The function is designed for Likert-type and rating-scale data and prioritises transparent diagnostics when ordinal reliability estimates are not feasible due to sparse response categories.
Cronbach’s alpha and McDonald’s omega are computed from Pearson correlations.
When include = "polychoric", ordinal reliability estimates are computed
using polychoric correlations and correspond to Zumbo’s alpha and ordinal omega.
Ordinal reliability estimates are skipped if response categories are sparse
or if polychoric estimation fails. Diagnostics explaining these decisions
are stored in the returned object and may be inspected using
ordinal_diagnostics.
This function assumes a single common factor and is not intended for multidimensional or structural equation modelling contexts.
A tibble with one row per reliability coefficient and columns:
coef_name: Name of the reliability coefficient.
estimate: Point estimate.
ci_lower, ci_upper: Confidence interval bounds
(only present when ci = TRUE).
notes: Methodological notes describing how the estimate
was obtained.
The returned object has class "likert_reliability" and includes
additional attributes containing diagnostics and bootstrap information.
ordinal_diagnostics
alpha_sensitivity, alpha
## create dataset
my_cor <- LikertMakeR::makeCorrAlpha(
items = 4,
alpha = 0.80
)
my_data <- LikertMakeR::makeScales(
n = 64,
means = c(2.75, 3.00, 3.25, 3.50),
sds = c(1.25, 1.50, 1.30, 1.25),
lowerbound = rep(1, 4),
upperbound = rep(5, 4),
cormatrix = my_cor
)
## run function
reliability(my_data)
reliability(
my_data,
include = c("lambda6", "polychoric")
)
## slower (not run on CRAN checks)
reliability(
my_data,
include = "polychoric",
ci = TRUE,
n_boot = 200
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.