Hi,

when working on my multivariate statistic package I found the following bug in function msortby:
If one wants to sort an already sorted matrix the matrix elements get though rearranged.
In the 2-factor Anova with interaction this results in wrong calculations.

<hansl>
nulldata 24
#two factor orthogonal Anova
matrix FaktorA={1;1;1;1;1;1;2;2;2;2;2;2;3;3;3;3;3;3;4;4;4;4;4;4}
matrix FaktorB={1;1;2;2;3;3;1;1;2;2;3;3;1;1;2;2;3;3;1;1;2;2;3;3}
matrix OutputM={69;77;61;67;65;69;79;83;62;64;72;78;80;78;74;76;80;74;75;67;70;62;70;76}

eval OutputM~FaktorA
eval msortby(OutputM~FaktorA,2)
<hansl>

Cheers
Leon