alpha                package:epicalc                R Documentation

_C_r_o_n_b_a_c_h'_s _a_l_p_h_a

_D_e_s_c_r_i_p_t_i_o_n:

     Calculate reliability coefficient of items in a data frame

_U_s_a_g_e:

     alpha (vars, dataFrame = .data, casewise = FALSE, reverse = TRUE, 
         decimal = 4, vars.to.reverse = NULL, var.labels = TRUE, 
         var.labels.trunc =150)   
     alphaBest (vars, standardized = FALSE, dataFrame = .data) 

_A_r_g_u_m_e_n_t_s:

    vars: a vector containing at least three variables from the data
          frame

dataFrame: data frame where items are set as variables

casewise: whether only records with complete data will be used

 reverse: whether item(s) negatively correlated with other majority
          will be reversed prior to computation

 decimal: number of decimal places displayed

var.labels: presence of descriptions of variables in the last column of
          the output

var.labels.trunc: number of characters used for variable descriptions,
          long labels can be truncated

vars.to.reverse: variable(s) to reverse prior to computation

standardized: whether choosing the best subset of items is based on the
          standardized alpha coefficient, if FALSE then the
          unstandardized alpha coefficient is used

_D_e_t_a_i_l_s:

     This function is based on the 'reliability' function from package
     'Rcmdr', which computes Cronbach's alpha for a composite scale. 

     There must be at least three items in 'vars' specified by their
     names or their index in the data frame.

     The argument 'reverse' (default = TRUE) automatically reverses
     items negatively correlated with other majority into negative and
     reports the activities in the first column of the last result
     section. This can be overwritten by the argument 'vars.to.reverse'

     Similar to the 'reliability' function, users can see the effect of
     removing each item on the coefficents and the item-rest
     correlation. 

     'alphaBest' is a variant of 'alpha' for successive removal of
     items aiming to reach the highest possible Cronbach alpha. The
     resultant values include variable indices of excluded and
     remaining items, which can be forwarded to 'tableStack' to achieve
     total and mean scores of the best selected items. However, there
     is no promise that this will give the highest possible alpha.
     Manual attemps may also be useful in making comparison.

_V_a_l_u_e:

     A list. 

     'alpha' returns an object of class "alpha" 

   alpha: unstandardized alpha coefficient

std.alpha: standardized alpha coefficient

sample.size: sample size

use.method: method for handling missing values

    rbar: the average inter-item correlation

items.selected: names of variables included in the function

alpha.if.removed: a matrix of unstandardized and standardized alpha
          coefficients and correlation of each item with the rest of
          the items

  result: as above but includes a column showing the items that were
          reversed (if TRUE) and a column of item description. As a
          matrix, it could be sent to a spreadsheet software using
          'write.csv'

 decimal: decimal places

item.labels: a character vector containing descriptions of the items

best.alpha: the possible highest alpha obtained from the function

 removed: indices of items removed by the function

remaining: indices of the remaining items

items.reversed: names of items reversed

_A_u_t_h_o_r(_s):

     Virasakdi Chongsuvivatwong <cvirasak@medicine.psu.ac.th>

_S_e_e _A_l_s_o:

     'cronbach' from 'psy' package and 'reliability' from 'Rcmdr'
     package and 'tableStack' and 'unclassDataframe' of Epicalc

_E_x_a_m_p_l_e_s:

     data(Cars93, package="MASS")
     use(Cars93)
     alpha(vars=c(Min.Price:MPG.highway, EngineSize))

     data(Attitudes)
     use(Attitudes)

     alpha(qa1:qa18)  # Needs full screen of Rconsole
     alpha(qa1:qa18, var.labels.trunc=30) 
                      # Fits in with default R console screen

     alpha(qa1:qa18, reverse=FALSE)

     alphaBest(qa1:qa18) -> best.alpha
     best.alpha # .7621
     tableStack(best.alpha$remaining, reverse=TRUE)

     # Manual attempts by trial and error give the following
     alpha(c(qa1:qa9, qa15,qa18)) # .7644

