In R, we can calculate coefficient alpha with the alpha() function from the psych package.
If some of our items are negatively worded, we’ll need to use check.keys=TRUE to ensure that they get reversed by the function.
Alternatively (and preferably) reverse code them ourselves first!
# load some data from a measure of stress# stressdata is the dataset of responses# stress_items shows the wordings of the questionsload(url("https://uoepsy.github.io/data/reliablystressed.rdata"))library(psych)alpha(stressdata, check.keys =TRUE)$total
raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
0.75 0.753 0.766 0.233 3.04 0.0406 2.88 0.564 0.257
!Important! - if you have multiple dimensions to your measurement, you need to calculate alpha on the set of items for each one separately!
omega
In R, we can calculate McDonald’s Omega with the omega() function from the psych package, which requires us to specify how many factors there are.
If some of our items are negatively worded, we’ll need to use flip = TRUE to ensure that they get reversed by the function.
Alternatively (and preferably) reverse code them ourselves first!
# load some data from a measure of stress# stressdata is the dataset of responses# stress_items shows the wordings of the questionsload(url("https://uoepsy.github.io/data/reliablystressed.rdata"))library(psych)omega(stressdata, nfactors =1, flip =TRUE)$omega.tot
[1] 0.763
When we have more factors, omega gets more complicated, and will return us both \(\omega_{total}\), which is the proportion of the variance attributable to all factors, and \(\omega_{hierarchical}\) which posits a “higher order” or “general” factor \(g\) above all the factors in the model, and gives us the variance attributable to \(g\). In any cases where you are using \(\omega\), just think carefully about if you believe what you have to be measure of some single, overarching construct.