Optimización de Alfa de Cronbach

Resumen

En este trabajo se presenta principalmente una función que permite analizar cada uno de los items que estan dentro de una categoria de la escala de Likert, para optimizar el coficiente Alfa de Cronbach

Qué es Alfa de Cronbach

Este método de consistencia interna basado en el Alfa de Cronbach permite estimar la fiabilidad de un instrumento de medida a través de un conjunto de ítems que se espera que midan el mismo constructo o dimensión teórica.

La validez de un instrumento se refiere al grado en que el instrumento mide aquello que pretende medir. Y la fiabilidad de la consistencia interna del instrumento se puede estimar con el Alfa de Cronbach. Esta medida de la fiabilidad asume que los ítems (medidos en escala tipo Likert) miden un mismo constructo y que estén altamente correlacionados (Welch & Comer, 1988). Cuanto más cerca se encuentre el valor del alfa a 1 mayor es la consistencia interna de los ítems analizados. La fiabilidad de la escala debe obtenerse siempre con los datos de cada muestra para garantizar la medida fiable del constructo en la muestra concreta de investigación.

Como criterio general, George y Mallery (2003, p. 231) sugieren las recomendaciones siguientes para evaluar los coeficientes de Alfa de Cronbach:

  • Coeficiente alfa >.9 es excelente
  • Coeficiente alfa >.8 es bueno
  • Coeficiente alfa >.6 es cuestionable
  • Coeficiente alfa >.5 es pobre
  • Coeficiente alfa <.5 es inaceptable
Las siguientes líneas de código se muestra el análisis y optimización del Alfa de Cronbach, como base para esta implementación se tomá el script del Dr. Carlos Rodríguez, cronbach.R

#Cronbach Alpha analysis in R
#We used the script by Carlos Rodriguez and the "Alpha Team" created the script 
#about the " Reliability Analysis and Alpha Cronbach's Optimization"

# Professor Carlos RodrÃ?guez
# Cronbach alpha is one of the most widely used
# reliability or internal consistency measures in social,behavioral and
# education sciences.
# Alpha is reported in nearly every study that involves measuring a construct
# through multiple test items.

# One R package to perform a Cronbach Alpha Analysis is psy,
# another is coefficientalpha, we use psy for the exercise:

# In psy, missing values are omitted in a "listwise" way
# (all items are removed even if only one of them is missing).

# First, we need to call the psy and gdata packages
library (psy)

# Loading the dataset from anyways:

likert <- read.csv("likertPilot.csv", na.strings = "NA")

# It is recommended to generate a vector for each construct in the scale:
construct1 <- c("EP1","EP2","EP3","EP4","EP5","EP6")
construct2 <- c("CR1","CR2","CR3","CR4","CR5","CR6","CR7","CR8","CR9","CR10","CR11")
construct3 <- c("SU1","SU2","SU3","SU4","SU5")
construct4 <- c("OI1","OI2","OI3")
construct5 <- c("OSG1","OSG2","OSG3","OSG4","OSG5","OSG6")
construct6 <- c("MPU1","MPU2","MPU3","MPU4","MPU5","MPU6","MPU7","MPU8","MPU9")

# The cronbach command of the psy package computes the Cronbach reliability coefficient alpha.
# This coefficient may be applied to a series of items destinated to be aggregated in a single score.
# It estimates reliability in the framework of the domain sampling model.
#The next code shows the Alpha function's construction
alfa <- function(categoria)
{
  
  name<-deparse(substitute(categoria))
  valoralfa<-cronbach (likert[,categoria])
  if(valoralfa[3]<=.5) estatus<-'Not accepted.' else if( valoralfa[3]>.5 & valoralfa[3]<.6) estatus<-'poor.' else if(valoralfa[3]>.6 & valoralfa[3]<.7) estatus<-'questionable.' else if(valoralfa[3]>.7 & valoralfa[3]<.8) estatus<-'accepted.' else if(valoralfa[3]>.8 & valoralfa[3]<.9) estatus<-'good.' else if(valoralfa[3]>=.9) estatus<-'excellent.'
  
  alfa1<-c("The calculated alpha for the category:",name,"and the items",categoria,valoralfa,"Alpha:",estatus,"Discarded Item :","NA")
  data<- data.frame(alfa1)
  for (i in 1:length(categoria))
  {
    temp<-categoria
    temp2<-temp[-c(i)]
    valoralfa<-cronbach (likert[,temp2])
    if(valoralfa[3]<=.5) estatus<-'Not accepted.' else if( valoralfa[3]>.5 & valoralfa[3]<.6) estatus<-'poor.' else if(valoralfa[3]>.6 & valoralfa[3]<.7) estatus<-'questionable.' else if(valoralfa[3]>.7 & valoralfa[3]<.8) estatus<-'accepted.' else if(valoralfa[3]>.8 & valoralfa[3]<.9) estatus<-'good.' else if(valoralfa[3]>=.9) estatus<-'excellent.'
    alfa2<-c("The calculated alpha for the category:",name,"and the items",temp2,"",valoralfa,"Alpha:",estatus,"Discarded Item",temp[i])
    data<-cbind(data,alfa2)
    
  }
  mat<-as.matrix(data)
  MAT<-matrix(mat,nrow=(length(categoria)+1),ncol=(10+length(categoria)),byrow=TRUE)
  return(View(MAT))
}

#The Alpha function is executed, replacing as parameter "construct1" which is the Likert category. 

resultado<-alfa(construct2)
     positems<-length(resultado[1,])
     posalfas<-positems-4
     
#View(resultado)
     alfas<- as.numeric(as.vector((resultado[,posalfas])))
     items<- as.vector((resultado[,positems]))
     alfasoriginal<-rep(alfas[1],length(alfas))
     
     
     # Calculate range from min to max value of alfas
     g_range <- range( min(alfas) , alfas,max(alfas))
## Warning in min(alfas): ningún argumento finito para min; retornando Inf
## Warning in max(alfas): ningun argumento finito para max; retornando -Inf
     # Graph alfas using y axis that ranges from min to max 
     # value in alfas vector.  Turn off axes and 
     # annotations (axis labels) so we can specify them ourself
     
#    plot(alfas, type="o", col="blue", ylim=g_range, axes=FALSE, ann=FALSE)
     
     # Make x axis using items labels
#    axis(1, at=1:length(items), lab=items)
     
     # Make y axis with horizontal labels that display ticks at      
#    axis(2)
     
     # Create box around plot
#    box()
     
     # Graph alfasoriginal with red dashed line and square points
     
#    lines(alfasoriginal, type="o", pch=22, lty=2, col="red")
     
     # Create a title with a red, bold/italic font
#    title(main="Alphas vs discarded items", col.main="red", font.main=4)
     
     # Label the x and y axes with dark green text
#    title(xlab="Items discarded", col.lab=rgb(0,0.5,0))
#    title(ylab="Alphas", col.lab=rgb(0,0.5,0))
     
     # Create a legend at (1, g_range[2]) that is slightly smaller 
     # (cex) and uses the same line colors and points used by 
     # the actual plots 
#    legend(min(alfas)+.01, c("Alphas","Original"), cex=0.5, col=c("blue","red"), pch=10:10, lty=1:2);
     
     #END