Problem
In the documentation of comp(), it is stated that the test statistic used for the test for trend is defined as the sum of terms W(t) * [e_{ji} - n_{ji} e_i / n_i]. Yet, it seems to return the sum of terms the sum of terms W(t) * [n_{ji} e_i / n_i - e_{ji}].
Possible cause
Looking at the implementation of comp.ten, it seems that the part [e_{ji} - n_{ji} e_i / n_i] correspond to the variable eMP1, which is computed by predict.ten. In the implementation of predict.ten, the line res1[, (na1) := data.frame(as.matrix(res1) - e1)] then seems to imply that actually [n_{ji} e_i / n_i - e_{ji}] is computed.
Question
Am I misinterpretting the output and implementation, or is this a bug in the code?
Problem
In the documentation of
comp(), it is stated that the test statistic used for the test for trend is defined as the sum of terms W(t) * [e_{ji} - n_{ji} e_i / n_i]. Yet, it seems to return the sum of terms the sum of terms W(t) * [n_{ji} e_i / n_i - e_{ji}].Possible cause
Looking at the implementation of
comp.ten, it seems that the part [e_{ji} - n_{ji} e_i / n_i] correspond to the variableeMP1, which is computed bypredict.ten. In the implementation ofpredict.ten, the lineres1[, (na1) := data.frame(as.matrix(res1) - e1)]then seems to imply that actually [n_{ji} e_i / n_i - e_{ji}] is computed.Question
Am I misinterpretting the output and implementation, or is this a bug in the code?