2

I was wondering if there were a way to run a complete Cronbach's Alpha analysis (like that available in 'Reliability Analysis' in SPSS), including an Alpha value if item is deleted.

I've created a Cronbach function from Mathworks File Exchange, giving me:

% Calculate the number of items
k=size(X,2);

% Calculate the variance of the items' sum
VarTotal=nanvar(nansum(X'));

% Calculate the item variance
SumVarX=nansum(nanvar(X));

% Calculate the Cronbach's alpha
a=k/(k-1)*(VarTotal-SumVarX)/VarTotal;

In a 1000x60 matrix, I'd like to know the Alpha when each item across dimension 2 is deleted.

Is there an in-built function for something like this? Is it possible to update this code (or write new code) to that effect?

8eastFromThe3ast
  • 197
  • 1
  • 13

1 Answers1

2

OK, so it turns out it was simply a case of building the correct for loop.

as(60)=NaN; % preallocate output matrices
varargout(60)=NaN;
for ques = 1:size(twodm,2) % loop across items
    cols = 1:size(twodm,2);
    cols(ques)=[]; % ques only uses items that aren't `ques`
    [as(ques), varargout(ques)] = CronbachAlpha(twodm(:,cols)); % perform the test
end

The function CronbachAlpha was taken from this file, which calculates both standardised and unstandardised Alphas and is better than the one used in the question.

8eastFromThe3ast
  • 197
  • 1
  • 13
  • Hi, thanks for the post, I've just implemented a KR20/21 report in an asp.net webpage, and now need to add Chronbac's Alpha myself... Is your handle referring to Killington btw? – samus Jan 12 '15 at 15:15