# Averaging Ripley's K or L function for several samples

Would much appreciate to hear your opinion about the following strategy:

I have several samples of point patterns, witch are results from somw replicated experiment. The number of points and area of observation vary from experiment to experiment. I would like to test a null hypothesis on CSR for this set of data using Ripley's function and make a conclusion for the overall population.

For each experiment I compute L function and corresponding confidence envelopes. In the end I average all the L functions and CEs and look at the behavior of the this averaged quantities.

Do you think that averaging can lead to misleading results?

Thank you!!!

## 1 Answer

May I suggest that you look at chapter 16 of Baddeley, Rubak & Turner (2015) Spatial Point Patterns: Methodology and Applications with R. Specifically Section 16.8 Analysing summary functions from replicated patterns seems very relevant to what you describe here. In that section you will learn about the generic function pool (with methods pool.fv and pool.envelope) that you can use to pool the estimates correctly. If you don't have access to the book you can have a look at the relevant vignette:

vignette("replicated", package="spatstat")


Please be aware that the envelopes we provide by default in spatstat are NOT confidence envelopes! These are simulation envelopes under a given null model and indicate (by default) the pointwise non-rejection region of a Monte Carlo test. Again this is explained in detail in the book in chapter 10, but you can also find a short discussion explaining the difference in Section 7.3.3 Use of the empirical K-function which has the advantage of being part of the free sample chapter 7 downloadable from the companion website http://book.spatstat.org

Disclaimer: I'm coauthor of the book mentioned above, but this is not (only) from shameless self promotion -- it is also the definitive reference on spatstat, so it is very relevant if you use spatstat to do your actual calculations.

• I successfully applied pooling. I plan to use MAD test on the pooled data. For example E1<-envelope(Data1,Lest, savefuns=TRUE) E2<-envelope(Data1,Lest, savefuns=TRUE); p<-pool(E1,E2); mad.test(p). To me it seems to be a fair strategy to make a conclusion about population Data1, Data2. I was wandering if I am missing something?Thanks again! – Sp_J Jul 31 '17 at 7:59