R/cronbach.R

Defines functions cronbach

Documented in cronbach

#' @importFrom stats na.omit
#' @export
cronbach <-
  function(v1)
  {
    v1 <- na.omit(v1)
    nv1 <- ncol(v1)
    pv1 <- nrow(v1)
    alpha <- (nv1/(nv1-1))*(1 - sum(apply(v1,2,var))/var(apply(v1,1,sum)))
    resu <- list("sample.size"=pv1,"number.of.items"=nv1,"alpha"=alpha)
    resu
  }

Try the psy package in your browser

Any scripts or data that you put into this service are public.

psy documentation built on April 22, 2022, 1:08 a.m.