qnn.test: q Nearest Neighbors Test

Description Usage Arguments Value Author(s) References Examples

View source: R/qnn.test.R

Description

qnn.test calculates statistics related to the q nearest neighbors method of comparing case and control point patterns under the random labeling hypothesis.

Usage

1
qnn.test(x, q = 5, nsim = 499, case = 2, longlat = FALSE)

Arguments

x

A ppp object from the spatstat package with marks for the case and control groups.

q

A vector of positive integers indicating the values of q for which to do the q nearest neighbors test.

nsim

The number of simulations from which to compute p-value.

case

The position of the name of the "case" group in levels(x$marks). The default is 2.

longlat

A logical value indicating whether Euclidean distance (FALSE) or Great Circle (WGS84 ellipsoid, FALSE) should be used. Default is FALSE, i.e., Euclidean distance.

Value

Returns a list with the following components:

qsum

A dataframe with the number of neighbors (q), test statistic (Tq), and p-value for each test.

consum

A dataframe with the contrasts (contrast), test statistic (Tcon), and p-value (pvalue) for the test of contrasts.

Author(s)

Joshua French

References

Waller, L.A., and Gotway, C.A. (2005). Applied Spatial Statistics for Public Health Data. Hoboken, NJ: Wiley.

Cuzick, J., and Edwards, R. (1990). Spatial clustering for inhomogeneous populations. Journal of the Royal Statistical Society. Series B (Methodological), 73-104.

Alt, K.W., and Vach, W. (1991). The reconstruction of "genetic kinship" in prehistoric burial complexes-problems and statistics. Classification, Data Analysis, and Knowledge Organization, 299-310.

Examples

1
2
data(grave)
qnn.test(grave, q = c(3, 5, 7, 9, 11, 13, 15))

Example output

$qsum
   q  Tq pvalue
1  3  32  0.010
2  5  45  0.014
3  7  58  0.020
4  9  73  0.012
5 11  91  0.010
6 13 109  0.010
7 15 122  0.014

$consum
    contrast Tcontrast pvaluecon
1    T5 - T3        13     0.428
2    T7 - T3        26     0.396
3    T9 - T3        41     0.254
4   T11 - T3        59     0.098
5   T13 - T3        77     0.038
6   T15 - T3        90     0.054
7    T7 - T5        13     0.456
8    T9 - T5        28     0.254
9   T11 - T5        46     0.090
10  T13 - T5        64     0.030
11  T15 - T5        77     0.050
12   T9 - T7        15     0.244
13  T11 - T7        33     0.052
14  T13 - T7        51     0.022
15  T15 - T7        64     0.024
16  T11 - T9        18     0.060
17  T13 - T9        36     0.018
18  T15 - T9        49     0.032
19 T13 - T11        18     0.066
20 T15 - T11        31     0.108
21 T15 - T13        13     0.454

smacpod documentation built on July 8, 2020, 7:10 p.m.

Related to qnn.test in smacpod...