dat <- data.frame(item1 = c(4, 2, 3, 4, 1, 2, 4, 2), item2 = c(4, 3, 3, 3, 2, 2, 4, 1),
item3 = c(3, 2, 4, 2, 1, 3, 4, 1), item4 = c(4, 1, 2, 3, 2, 3, 4, 2))
# Example 1: Compute unstandardized coefficient alpha and item statistics
item.alpha(dat)
# Example 2: Compute standardized coefficient alpha and item statistics
item.alpha(dat, std = TRUE)
# Example 3: Compute unstandardized coefficient alpha
item.alpha(dat, print = "alpha")
# Example 4: Compute item statistics
item.alpha(dat, print = "item")
# Example 5: Compute unstandardized coefficient alpha and item statistics while excluding item3
item.alpha(dat, exclude = "item3")
# Example 6: Compute unstandradized coefficient alpha based on the variance-covariance matrix
item.alpha(cov(dat))
# Example 7: Compute standardized coefficient alpha based on the correlation matrix
item.alpha(cor(dat))
# Example 8: Compute ordinal coefficient alpha
item.alpha(dat, ordered = TRUE)
if (FALSE) {
# Example 9a: Write Results into a text file
result <- item.alpha(dat, write = "Alpha.xlsx")}
Run the code above in your browser using DataLab