Learn R Programming

bruceR (version 0.7.2)

Alpha: Reliability analysis (Cronbach's \(\alpha\) and McDonald's \(\omega\)).

Description

An extension of jmv::reliability(). It reports (1) scale reliability statistics (Cronbach's \(\alpha\) and McDonald's \(\omega\)) and (2) item reliability statistics (item-rest correlation [i.e., corrected item-total correlation] and what Cronbach's \(\alpha\) and McDonald's \(\omega\) would be if the item was dropped).

Three options to specify the variable list:

  1. var + items: use the common and unique parts of variable names.

  2. vars: directly define a variable list.

  3. varrange: use the start and end positions of a variable list.

Usage

Alpha(data, var, items, vars = NULL, varrange = NULL, rev = NULL)

Arguments

data

Data frame.

var

[option 1] Common part across multiple variables (e.g., "RSES", "SWLS").

items

[option 1] Unique part across multiple variables (e.g., 1:10).

vars

[option 2] Character vector specifying a variable list (e.g., c("E1", "E2", "E3", "E4", "E5")).

varrange

[option 3] Character with ":" specifying the start and end positions of a variable list (e.g., "A1:E5").

rev

[optional] Reverse-scoring variables. It can be (1) a numeric vector specifying the positions of reverse-scoring variables (not recommended) or (2) a character vector directly specifying the variable list (recommended).

Value

A result object obtained from jmv::reliability().

See Also

MEAN

Examples

Run this code
# NOT RUN {
# ?psych::bfi
Alpha(bfi, "E", 1:5)  # "E1" & "E2" should be reverse scored
Alpha(bfi, "E", 1:5, rev=1:2)  # correct
Alpha(bfi, "E", 1:5, rev=c("E1", "E2"))  # also correct
Alpha(bfi, vars=c("E1", "E2", "E3", "E4", "E5"), rev=c("E1", "E2"))
Alpha(bfi, varrange="E1:E5", rev=c("E1", "E2"))

# using dplyr::select()
bfi %>% select(E1, E2, E3, E4, E5) %>%
  Alpha(vars=names(.), rev=c("E1", "E2"))

# }

Run the code above in your browser using DataLab