Re: [R] Permutation test of marked point pattern

From: Patrick Burns <>
Date: Fri 05 May 2006 - 18:44:25 EST

For completeness of the archives, this problem seems to have been solved via a private conversation.

 From my perspective the problem was trying to complicate a situation that was essentially solved. Instead of trying to comprehend how to conform the present situation to someone's implementation of a permutation test, it is much easier to just do the computation. Something like:

permvec <- numeric(1000)
for(i in 1:1000) permvec[i] <- p.value <- mean(permvec <= original.statistic)

I think the same is true of bootstrapping. This is more controversial since there are some techniques -- such as bias correction -- with bootstrapping that can improve the results. However, virtually always in the work that I do a naive bootstrap is good enough.

Patrick Burns
+44 (0)20 8525 0696
(home of S Poetry and "A Guide for the Unwilling S User")

Jean-Francois Savard wrote:

>Dear R users,
>I am trying to perform a hypothesis test on a marked point pattern. I
>would like to calculate the mean of the absolute value of the
>difference of marks between nearest neigbours, randomize the marks
>among points, then calculate this mean again. Ideally, I would test
>whether random mean values smaller than the observed mean value occur
>less than 5% of the time. I suppose 1000 permutations would be a
>reasonable starting point (the ppp object has 27 points).
>so far, I've figured out how to:
>-create a marked ppp object: ms.ppp
>-calculate my test statistic:
>teststat <- mean(abs(markstat(ms.ppp, diff, N=2)))
>-randomly allocate marks to a point pattern:
>Y <- rlabel (ms.ppp, labels=ms.ppp$marks, permute=TRUE)
>I have looked at perm.test{exactRankTests} and perused the R help
>archive but haven't been able to find how to work the permutation test
>with a marked ppp object.
>I thank you in advance for any help,
>J-F Savard
>Doctoral Candidate
>University of Maryland
> mailing list
>PLEASE do read the posting guide!
> mailing list PLEASE do read the posting guide! Received on Fri May 05 18:46:34 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 05 May 2006 - 20:10:05 EST.

Mailing list information is available at Please read the posting guide before posting to the list.