R-Lum/Luminescence

calc_HomogeneityTest() ... wrong calculation(?)

Closed this issue · 3 comments

Expected behaviour

The test should test against the null hypothesis that the values including the standard errors
are resulting from a common distribution. If P is small enough the null hypothesis should be rejected.

Observed behaviour

P = 1 is returned even for datasets which are a mix of two distributions.

Running mini example

library(Luminescence)
calc_HomogeneityTest(do.call(what = rbind, ExampleData.DeValues))

Reason

Please check code line 101, the lower.tail = FALSE appears to be the wrong argument setting.

Ok, this was probably not the reason, but the log transformation is wrong. The standard error is not just simply the logarithm if the dose log-transformed. The relationship is that the log-dose is 'effectively the relative standard error of the dose' (Galbraith, 2003, see also Galbraith et al., 1999).

@tzerk Please double check. Now it should be ok, however, please check again.

tzerk commented

You are absolutely correct. But I have no idea how this error was introduced, as I did also cross-check with the worked example in Galbraith (2003). The proposed fix produces the correct results and thanks for including the test.