y <- attitude #from the datasets package
x <- rowSums(y) #find the sum of the seven attitudes
alpha.scale(x,y)
#[1] 0.8431428
#compare with standardized alpha:
st.alpha <- cluster.cor(rep(1,7),cor(attitude),digits=4)
st.alpha
#compare with score.items
si <- score.items(rep(1,7), attitude,digits=3)
si$alpha
Run the code above in your browser using DataLab