Returns a data.frame with item analyses for the provided scales.

nice_alpha_table(
  data,
  scales,
  labels = NULL,
  round = 2,
  ci = TRUE,
  conf_level = 0.95,
  check_key = TRUE,
  keys = NULL,
  keys_from_weights = FALSE,
  RMSEA = FALSE,
  difficulty = FALSE,
  values = NULL,
  fa = TRUE
)

alpha_table(
  data,
  scales,
  labels = NULL,
  round = 2,
  ci = TRUE,
  conf_level = 0.95,
  check_key = TRUE,
  keys = NULL,
  keys_from_weights = FALSE,
  RMSEA = FALSE,
  difficulty = FALSE,
  values = NULL,
  fa = TRUE
)

Arguments

data

A data Frame

scales

A list containing vectors with variable names. Each list element defines one scale. Named list elements are used as labels.

labels

Label names for scales (defaults to named list elements in 'scales').

round

Rounds values to given decimal position.

ci

If TRUE confidence intervals are calculated.

conf_level

Confidence level (e.g. 0.95 for 95 percent).

check_key

Check_key for the psych::alpha function.

keys

Optional key argument for the psych::alpha function.

keys_from_weights

If TRUE, tries to define keys from the weights dictionary attribute. These are only available when you defined them with the scaledic package.

RMSEA

If TRUE RMSEA is calculated.

difficulty

If TRUE, the difficulty of the item is calculated.

values

Sets maximum and minimum valid values necessary to calculate item difficulty.

fa

If TRUE, a one factor exploratory factor analyses is calculated and loadings are reported.

Value

A data frame with concise scale indices.

Examples

## Example needs packages scaledic and purrr installed and active
nice_alpha_table(
  data = wmisc:::ex_itrf,
  scales = wmisc:::ex_itrf_scales,
  labels = c("Inernalizing", "Externalizing"),
  keys_from_weights = TRUE,
  difficulty = TRUE,
  values = list(c(0, 3)),
  RMSEA = TRUE
)
#> Error in names(keys) <- colnames(x): 'names' attribute [19] must be the same length as the vector [0]
#> 
#> Cautions:
#> 1: Removed 1 rows because all items were missing.
#> 2: Weights from scaledic attributes are missing.

nice_alpha_table(
  wmisc:::data_emo,
  wmisc:::data_emo_scales,
  check_key = TRUE,
  difficulty = TRUE,
  value = list(c(0,4))
  )
Table
Item analysis
Scale
N
Alpha [95% CI]
Homogeneity Discriminations Difficulties Means SDs |Loadings|
items cases Raw Standardized
Grundeinstellung 6 [145, 146] .68 [.59, .75] .68 [.59, .75] .26 [.29, .60] [.47, .81] [1.86, 3.23] [0.92, 1.15] [.33, .83]
Resilienz 5 [146, 146] .60 [.49, .69] .60 [.49, .69] .23 [.30, .40] [.43, .62] [1.72, 2.49] [1.06, 1.18] [.41, .56]
Intuition 6 [145, 146] .80 [.75, .85] .81 [.75, .85] .41 [.41, .68] [.70, .80] [2.79, 3.2] [0.73, 1.05] [.45, .78]
Selbstwahrnehmung 4 [145, 146] .72 [.63, .78] .72 [.64, .79] .39 [.45, .63] [.62, .70] [2.47, 2.78] [0.95, 1.09] [.53, .83]
Sensibilität 5 [146, 146] .57 [.45, .67] .58 [.46, .68] .21 [.20, .45] [.64, .82] [2.58, 3.27] [0.87, 1.05] [.29, .65]
Aufmerksamkeit 6 [146, 146] .80 [.75, .85] .80 [.75, .85] .41 [.51, .69] [.35, .56] [1.41, 2.23] [1.01, 1.25] [.57, .81]
Note. Values in brackets depict upper and lower bound of confidence intervals or [min,max] intervals. N cases is the min and max number of non-missing cases for the scale items.