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))
# Compute unstandardized coefficient alpha and item statistics
item.alpha(dat)
# Compute standardized coefficient alpha and item statistics
item.alpha(dat, std = TRUE)
# Compute unstandardized coefficient alpha
item.alpha(dat, print = "alpha")
# Compute item statistics
item.alpha(dat, print = "item")
# Compute unstandardized coefficient alpha and item statistics while excluding item3
item.alpha(dat, exclude = "item3")
# Compute variance-covariance matrix
dat.cov <- cov(dat)
# Compute unstandardized coefficient alpha based on the variance-covariance matrix
item.alpha(dat.cov)
# Compute correlation matrix
dat.cor <- cor(dat)
# Compute standardized coefficient alpha based on the correlation matrix
item.alpha(dat.cor)
# Compute ordinal coefficient alpha
item.alpha(dat, ordered = TRUE)
if (FALSE) {
# Write Results into a Excel file
result <- item.alpha(dat, write = "Alpha.xlsx")
result <- item.alpha(dat, output = FALSE)
write.result(result, "Alpha.xlsx")
}
Run the code above in your browser using DataLab