Search code examples
spatstat

Using studpermu.test in spatstat on hyperframes with only 2 point patterns per group


I seem to be having an issue implementing studpermu.test on my point pattern data. The R documentation for studpermu.test states the minimum number of point patterns per group for between group comparisons is 2, however I get the following error whenever I try to run it on my 2x2 hyperframe: 'Error: Data groups need to contain at least two patterns; after discarding those with fewer than 20 points, the remaining group sizes are 2 and 2'

The form of the hyperframe is as follows: Hyperframe: patterns group 1 (ppp) A 2 (ppp) A 3 (ppp) B 4 (ppp) B

The npoints per pattern are all very large so it definitely satisfies that condition. Does anyone know if this is a bug in the code? Unfortunately it is difficult to obtain more empirical point patterns due to the nature of the experiment so it would be ideal if I could run such a test on these group sizes. I've also had difficulty fitting point process models to my data [would have been a good workaround] due to some clustering and repulsion interactions at different scales so I'm stuck with comparing these for now. If anyone has any alternative ideas for comparing the point patterns [each group is a set of replicates with slightly different window sizes], that would be great as well.


Solution

  • The current implementation of studpermu.test checks that there are at least THREE point patterns in each group. If not, then it issues an error message stating that there must be "at least TWO" patterns in each group. That is, the error message disagrees with the code.

    I will contact the original author to find out what the original intention was, and make the error message consistent with the code.