
miammt = [...
1  0.1334  0.2194;  ...
2  0.1214  0.1929;  ...
3  0.1276  0.1833;  ...
4  0.1152  0.1879;  ...
5  0.1047  0.2529; ...
6  0.1312  0.2527; ...
7  0.1222  0.2595; ...
8  0.2569  0.2726; ...
9  0.2101  0.2234; ...
10 0.1852  0.2216; ...
11 0.1798  0.1905; ...
12 0.1049  0.1444; ...
13 0.2649  0.2841; ...
14 0.2383  0.2731];

miatreat = miammt(1:7,2);
miacont  = miammt(1:7,3);
mmttreat = miammt(8:14,2);
mmtcont  = miammt(8:14,3);

miadif = miatreat - miacont;
mmtdif = mmttreat - mmtcont;

% tmia = mean(miadif)/(std(miadif)/7)
% tmmt = mean(mmtdif)/(std(mmtdif)/7)
% 
% pvalmia = tcdf( tmia, 6)
% pvalmmt = tcdf( tmmt, 6)

[W, Z, p] = wsirt( miatreat, miacont, 0 )

% W = -28
% Z = -2.3664
% p = 0.0225
% 


[W, Z, p] = wsirt( mmttreat, mmtcont, 0 )

% W = -28
% Z = -2.3664
% p = 0.0225
% 



% t = mean(miadif - mmtdif)/sqrt( var(miadif)/7 + var(mmtdif)/7 )
[W, Z, p] = wsurt(miadif,mmtdif, 0 )
% W = 28
% Z = -3.1305
% p =0.0016


rmia = corr(miatreat, miacont) %-0.1197

n=7;
t1 = rmia * sqrt(n-2)/sqrt(1 - rmia^2) %-0.2696
p1 = tcdf( -abs(t1), n-2)  %0.3991
%
rmmt = corr(mmttreat, mmtcont)  %0.9772
t2 = rmmt * sqrt(n-2)/sqrt(1 - rmmt^2)  %10.2945
p2 = tcdf( -abs(t2), n-2) %7.4354e-005
