0

I have a bunch of data sets in R with problematic cronbach's alphas. These data have no missing values so I calculate alpha with something like:

cronbach <- function(x){
colx <- ncol(x)
value <- (1-sum(apply(x,2,var))/var(apply(x,1,sum)))*(colx/(colx-1))
return(value)}

What I need is a function that not only calculates alpha but also:

  1. Calculates alpha if an item (column) deleted
  2. Calculates alpha if a case (row) deleted
    for Dataframe or Matrix of any reasonable dimension.

    Thanks in advance.

sar.ali
  • 13
  • 4
  • 2
    Please consider adding sample data and code attempted (with errors, if appropriate). (I recommend you read through [help/mcve](http://stackoverflow.com/help/mcve) and [reproducible examples](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Without knowing what your data looks like, there is a lot of speculation, which will often result in either (a) people not trying, or (b) unusable answers.) – r2evans Aug 08 '16 at 16:56
  • SO is not a code-writing service or tutorial site. Please make an earnest effort wth [reproducible example](http://stackoverflow.com/help/mcve) and return with a specific issue to troubleshoot. – Parfait Aug 08 '16 at 16:58
  • you are right, but I'm neither a statistician nor a programmer. I really don't want to share my data and I have no Idea how to reproduce them. and believe me, codes I attempted just make people laugh :-) – sar.ali Aug 08 '16 at 17:18

0 Answers0