Learn R Programming

multicon (version 1.6)

alpha.cov: Cronbach's Alpha of Covariance Matrix

Description

Returns Cronbach's alpha from a covariance matrix

Usage

alpha.cov(sigma)

Arguments

sigma
A square covariance or correlation matrix

Value

Returns Standardized alpha when a correlation matrix is the input, and returns Raw alpha when a covariance matrix is input.

Details

If a correlation matrix is provided rather than a covariance matrix, the result is a standardized Cronbach's alpha

See Also

alpha

Examples

Run this code
data(RSPdata)
names(RSPdata)
	# Forming a composite:
	# We will first form a composite extraversion variable using
	# BFI scores. 
    # Three items need to be reverse scored
sBFI6r <- 6 - RSPdata$sBFI6
sBFI21r <- 6 - RSPdata$sBFI21
sBFI31r <- 6 - RSPdata$sBFI31
    # Now put them all into one data.frame
ext.vars <- data.frame(RSPdata$sBFI1, sBFI6r, RSPdata$sBFI11, 
	RSPdata$sBFI16, sBFI21r, RSPdata$sBFI26, sBFI31r, RSPdata$sBFI36)
head(ext.vars) # Looks good
  # Get the internal consistency stats using the alpha() function in the
  # psych package
alpha(ext.vars)
  # We can also get alpha from the correlation/covariance matrices
alpha.cov(cor(ext.vars))  # Standardized Alpha
alpha.cov(cov(ext.vars))  # Raw Alpha
	

Run the code above in your browser using DataLab