@BenBolker told you to look at the help page for isSymmetric which directs you to all.equal
. You built this matrix:
> mat1
(Intercept) outcome2 outcome3 treatment2 treatment3
(Intercept) 150 4.000000e+01 4.700000e+01 5.000000e+01 5.000000e+01
outcome2 40 4.000000e+01 2.237910e-14 1.333333e+01 1.333333e+01
outcome3 47 2.476834e-14 4.700000e+01 1.566667e+01 1.566667e+01
treatment2 50 1.333333e+01 1.566667e+01 5.000000e+01 2.710506e-14
treatment3 50 1.333333e+01 1.566667e+01 2.818926e-14 5.000000e+01
The test in all.equal
is tolerance = .Machine$double.eps ^ 0.5
, so none of your tests were actually the same as the one without an argument. (In the case of very small numbers the sqrt is actually quite a bit bigger.) Notice there is an additional test regarding equality of row and column names which your example would have satisfied.
If you look at the help page you should become suspicious about your understanding of what all.equal might be doing when yious see sthat is is testing ‘near equality’
and then refers you to the Details where it says:
Numerical comparisons for scale = NULL (the default) are done by first computing the mean
absolute difference of the two numerical vectors.
In the code you can see that it is not individual differences being tested relative to the tolerance but the mean absolute differences.