Skip to contents

Compute per-scale internal-consistency reliability — Cronbach's alpha and McDonald's omega — for the HiTOP Self-Report (405 items). Reliability is estimated on the reverse-keyed item responses for each of the scales that score_hitopsr() outputs.

Usage

reliability_hitopsr(
  data,
  items,
  srange = c(1, 4),
  alpha = TRUE,
  omega = TRUE,
  module = NULL,
  layout = c("instrument", "printed"),
  subset = NULL
)

Arguments

data

A data frame containing the HiTOP-SR items (numerically coded): all 405 of them, or, when module is supplied, that module's items.

items

A vector of column names (as strings) or numbers (as integers) corresponding to the HiTOP-SR items held in data — all 405, or, when module is supplied, that module's items. Items must be supplied in instrument order, or in the form's printed order under layout = "printed"; duplicated entries are an error. The ascending-name warning score_hitopsr() describes reads the names you supply, so under layout = "printed" it also fires for original-number names in printed order; it can be ignored there, or avoided by supplying positions.

srange

An optional numeric vector specifying the minimum and maximum values of the HiTOP-SR items, used for reverse-coding. (default = c(1, 4))

alpha

Optional logical; if TRUE, include a column of Cronbach's alpha per scale. (default = TRUE)

omega

Optional logical; if TRUE, include a column of McDonald's omega (total) per scale, estimated via a one-factor CFA (requires the lavaan package). (default = TRUE)

module

An optional hitop_module object, as returned by hitop_module(), describing a module of the instrument. When supplied, data and items hold only that module's item columns — in ascending instrument order, as the generate_*_hitopsr() forms lay them out — and one row is returned per module scale. When NULL, all 405 items are expected and all 76 scales are estimated. (default = NULL)

layout

The order the item columns are in. "instrument" (the default) is ascending HiTOP-SR order, as the generate_*_hitopsr() forms lay the items out. "printed" is the order a shuffled Word form printed them: column k holds the answer to the form's printed item k. It needs a module carrying an item_order attribute, the record a module descriptor written by generate_docx_hitopsr() with randomize = TRUE keeps and read_module() returns; the columns are put back into instrument order through that attribute before the estimates run. A call with layout = "printed" and no module, a module with no item_order, or an item_order that is not a permutation of the module's items is an error. (default = "instrument")

subset

Deprecated. The former name of module; supplying it warns. Supplying both module and subset is an error. (default = NULL)

Value

A tibble with one row per scale and columns Scale (the scale's canonical display name, as the instrument's keying table spells it), camelCase (the stem that names the scale's column in the matching score_*() output, read from the same keying-table row), nItems (integer), and (when requested) alpha and omega.

Details

Alpha is computed by calc_alpha() (covariance-based, pairwise deletion) and omega by calc_omega() (one-factor lavaan CFA, FIML). A scale whose estimate cannot be computed (e.g. too few items or, for omega, a non-converging CFA or an uninstalled lavaan) is returned as NA rather than aborting the call.

Examples

# Per-scale alpha for the HiTOP-SR
reliability_hitopsr(sim_hitopsr, items = 1:405, omega = FALSE)
#> # A tibble: 76 × 4
#>    Scale                camelCase           nItems    alpha
#>    <chr>                <chr>                <int>    <dbl>
#>  1 Agoraphobia          agoraphobia              5 -0.108  
#>  2 Antisocial Behavior  antisocialBehavior       8 -0.136  
#>  3 Appearance Focus     appearanceFocus          5 -0.0282 
#>  4 Appetite Loss        appetiteLoss             3  0.00603
#>  5 Binge Eating         bingeEating              3  0.0509 
#>  6 Bodily Distress      bodilyDistress           6  0.0879 
#>  7 Body Dissatisfaction bodyDissatisfaction      4 -0.0891 
#>  8 Callousness          callousness              6 -0.347  
#>  9 Checking             checking                 5 -0.247  
#> 10 Cleaning             cleaning                 6  0.174  
#> # ℹ 66 more rows

# Per-scale alpha for data collected with a two-scale module. Select the
# item columns by name: `m$items` holds original HiTOP-SR numbers, which are
# column positions only in a data frame that is exactly the 405 items in order.
m <- hitop_module("hitopsr", scales = c("Agoraphobia", "Appetite Loss"))
collected <- sim_hitopsr[sprintf("hsr_%03d", m$items)]
reliability_hitopsr(collected, items = names(collected), module = m, omega = FALSE)
#> # A tibble: 2 × 4
#>   Scale         camelCase    nItems    alpha
#>   <chr>         <chr>         <int>    <dbl>
#> 1 Agoraphobia   agoraphobia       5 -0.108  
#> 2 Appetite Loss appetiteLoss      3  0.00603

# The same for data entered off a shuffled form: the columns are in the
# order the form printed its items, recorded on the module's `item_order`
# attribute (here set by hand; a descriptor written with `randomize = TRUE`
# carries it).
attr(m, "item_order") <- c(144L, 202L, 66L, 389L, 260L, 109L, 291L, 118L)
printed <- collected[match(attr(m, "item_order"), m$items)]
reliability_hitopsr(printed, items = seq_along(printed), module = m,
                    layout = "printed", omega = FALSE)
#> # A tibble: 2 × 4
#>   Scale         camelCase    nItems    alpha
#>   <chr>         <chr>         <int>    <dbl>
#> 1 Agoraphobia   agoraphobia       5 -0.108  
#> 2 Appetite Loss appetiteLoss      3  0.00603