Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Alpha

Reliability analysis (Cronbach's α and McDonald's ω).


Description

An extension of jmv::reliability(). It reports (1) scale reliability statistics (Cronbach's α and McDonald's ω) and (2) item reliability statistics (item-rest correlation [i.e., corrected item-total correlation] and what Cronbach's α and McDonald's ω 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

Examples

# see ?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"))

bruceR

Broadly Useful Convenient and Efficient R Functions

v0.6.2
GPL-3
Authors
Han-Wu-Shuang Bao [aut, cre]
Initial release
2021-04-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.