studpermu.test: Studentised Permutation Test

Description Usage Arguments Details Value Author(s) References Examples


Perform a studentised permutation test for a difference between groups of point patterns.


   studpermu.test(X, formula, summaryfunction = Kest,
       ..., rinterval = NULL, nperm = 999,
        use.Tbar = FALSE, minpoints = 20, rsteps = 128,
        r = NULL, = FALSE)



Data. Either a hyperframe or a list of lists of point patterns.


Formula describing the grouping, when X is a hyperframe. The left side of the formula identifies which column of X contains the point patterns. The right side identifies the grouping factor. If the formula is missing, the grouping variable is taken to be the first column of X that contains a factor, and the point patterns are taken from the first column that contains point patterns.


Summary function applicable to point patterns.


Additional arguments passed to summaryfunction.


Interval of distance values r over which the summary function should be evaluated and over which the test statistic will be integrated. If NULL, the default range of the summary statistic is used (taking the intersection of these ranges over all patterns).


Number of random permutations for the test.


Logical value indicating choice of test statistic. If TRUE, use the alternative test statistic, which is appropriate for summary functions with roughly constant variance, such as K(r)/r or L(r).


Minimum permissible number of points in a point pattern for inclusion in the test calculation.


Number of discretisation steps in the rinterval.


Optional vector of distance values as the argument for summaryfunction. Should not usually be given. There is a sensible default.

Logical. If TRUE, individual extra arguments to summaryfunction will be taken from X (which must be a hyperframe). This assumes that the first argument of summaryfunction is the point pattern dataset.


This function performs the studentized permutation test of Hahn (2012) for a difference between groups of point patterns.

The first argument X should be either

a list of lists of point patterns.

Each element of X will be interpreted as a group of point patterns, assumed to be replicates of the same point process.

a hyperframe:

One column of the hyperframe should contain point patterns, and another column should contain a factor indicating the grouping. The argument formula should be a formula in the R language specifying the grouping: it should be of the form P ~ G where P is the name of the column of point patterns, and G is the name of the factor.

A group needs to contain at least two point patterns with at least minpoints points in each pattern.

The function returns an object of class "htest" and "studpermutest" that can be printed and plotted. The printout shows the test result and p-value. The plot shows the summary functions for the groups (and the group means if requested).


Object of class "studpermutest".


Ute Hahn.

Modified for spatstat by \adrian


and \ege


Hahn, U. (2012) A studentized permutation test for the comparison of spatial point patterns. Journal of the American Statistical Association 107 (498), 754–764.


  np <- if(interactive()) 99 else 19
  testpyramidal <- studpermu.test(pyramidal, Neurons ~ group, nperm=np)

spatstat documentation built on May 30, 2017, 7:53 a.m.

Search within the spatstat package
Search all R packages, documentation and source code