This function calculates the Spearman-Brown reliability for a two-item scale, which is the recommended measure for two-item scales (rather than Cronbach's alpha, which is used for longer scales.)

spearman_brown(data, items, name = "", SB_only = FALSE)

Source

https://www.r-bloggers.com/five-ways-to-calculate-internal-consistency/

Arguments

data

A dataframe

items

Character vector of length 2, with names of the two items

name

Name of the scale, relevant only if data.frame is returned

SB_only

Logical, indicating whether to return only the reliability as a number or a dataframe that also includes the scale name and correlation.

Value

Either the Spearman-Brown coefficient as a single number, or a dataframe including the Pearson correlation coefficient and the scale name