Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hessen V4 (e) Test your i above in dumnns Solution global I J Mr N f vcrit comp

ID: 3603411 • Letter: H

Question

Hessen V4 (e) Test your i above in dumnns

Explanation / Answer

global I J Mr N f vcrit comp args=cell(varargin); nu=numel(args); if nu>2 || nu1 %check the ctrl value if ~isscalar(ctrl) || ~isfinite(ctrl) || ~isnumeric(ctrl) || isempty(ctrl) error('Warning: it is required a scalar, numeric and finite CTRL value.') end if ctrl ~= 0 && ctrl ~= 1 %check if tst is 0 or 1 error('Warning: CTRL must be 0 for multiple comparisons without a control group or 1 if a control group is present.') end end clear args default nu disp('STEPDOWN DUNN TEST FOR NON PARAMETRIC MULTIPLE COMPARISONS') disp(' ') k=max(x(:,2)); %number of groups N=crosstab(x(:,2)); %elements for each group tot=sum(N); %total elements R=ones(1,k); Mr=ones(k,2); %preallocation of sum of ranks and mean rank vectors [r,t]=tiedrank(x(:,1)); %ranks and ties f=(tot*(tot+1)/12)-(t/(6*(tot-1))); %costant denominator factor with ties correction disp('Group N Sum of ranks Mean rank') for I=1:k R(I)=sum(r(x(:,2)==I)); %sum of ranks of each group Mr(I,1)=R(I)/N(I); %mean ranks of each group Mr(I,2)=I; fprintf(' %d %d %11.2f %11.2f ',I,N(I),R(I),Mr(I,1)) end disp(' ') fprintf('Ties factor: %d ',2*t) disp(' ') clear idx R r t %clear unnecessary variables disp('Test Q-value Critical Q Comment') switch ctrl case 0 %Without control group kstar = 0.5*k*(k-1); alf = 1-0.95.^(1/kstar); %Sidak's value of alpha vcrit = -realsqrt(2)*erfcinv(2-alf); %critical value H=triu(ones(k,k),1); %preallocation of resuming matrix Mr=sortrows(Mr,-1); %sort the mean ranks; %In the second column of Mr there is the groups index. When sorted, this %index will be used by Qvalue function to point the correct N values %Compare the biggest mean rank with the lowest; %then check with the second and so on... %If there is no difference (Q