Alpha {bruceR}R Documentation

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

Description

An extension of psych::alpha() and psych::omega(), reporting (1) scale statistics (Cronbach's α and McDonald's ω) and (2) item statistics (item-rest correlation [i.e., corrected item-total correlation] and Cronbach's α if item deleted).

Three options to specify variables:

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

  2. vars: directly define a character vector of variables.

  3. varrange: use the starting and stopping positions of variables.

Usage

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

Arguments

data

Data frame.

var

[Option 1] The common part across the variables. e.g., "RSES"

items

[Option 1] The unique part across the variables. e.g., 1:10

vars

[Option 2] A character vector specifying the variables. e.g., c("X1", "X2", "X3", "X4", "X5")

varrange

[Option 3] A character string specifying the positions ("starting:stopping") of variables. e.g., "A1:E5"

rev

[Optional] Variables that need to be reversed. It can be (1) a character vector specifying the reverse-scoring variables (recommended), or (2) a numeric vector specifying the item number of reverse-scoring variables (not recommended).

digits, nsmall

Number of decimal places of output. Default is 3.

Value

A list of results obtained from psych::alpha() and psych::omega().

See Also

MEAN, EFA, CFA

Examples

# ?psych::bfi
data=psych::bfi
Alpha(data, "E", 1:5)  # "E1" & "E2" should be reversed
Alpha(data, "E", 1:5, rev=1:2)  # correct
Alpha(data, "E", 1:5, rev=c("E1", "E2"))  # also correct
Alpha(data, vars=c("E1", "E2", "E3", "E4", "E5"), rev=c("E1", "E2"))
Alpha(data, varrange="E1:E5", rev=c("E1", "E2"))

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


[Package bruceR version 0.8.0 Index]