date()
## [1] "Wed Mar 20 14:01:09 2013"
Using the ants data set
require(spatstat)
## Loading required package: spatstat
## Warning: package 'spatstat' was built under R version 2.15.2
## Loading required package: mgcv
## This is mgcv 1.7-18. For overview type 'help("mgcv-package")'.
## Loading required package: deldir
## Warning: package 'deldir' was built under R version 2.15.2
## deldir 0.0-21
## spatstat 1.31-0 Type 'help(spatstat)' for an overview of spatstat
## 'latest.news()' for news on latest version 'licence.polygons()' for
## licence information on polygon calculations
data(ants)
summary(ants)
## Marked planar point pattern: 97 points
## Average intensity 0.000226 points per square unit (one unit = 0.5 feet)
##
## Coordinates are integers
## i.e. rounded to the nearest 1 unit (one unit = 0.5 feet)
##
## Multitype:
## frequency proportion intensity
## Cataglyphis 29 0.299 6.76e-05
## Messor 68 0.701 1.59e-04
##
## Window: polygonal boundary
## single connected closed polygon with 11 vertices
## enclosing rectangle: [-25, 803] x [-49, 717] units
## Window area = 428922 square units
## Unit of length: 0.5 feet
plot(ants)
## Cataglyphis Messor
## 1 2
plot(split(ants))
cat = ants[ants$marks == "Cataglyphis"]
mes = ants[ants$marks == "Messor"]
G1 = Gest(cat)
plot(G1)
## lty col key label meaning
## km 1 1 km hat(G)[km](r) Kaplan-Meier estimate of G(r)
## rs 2 2 rs hat(G)[bord](r) border corrected estimate of G(r)
## han 3 3 han hat(G)[han](r) Hanisch estimate of G(r)
## theo 4 4 theo G[pois](r) theoretical Poisson G(r)
G2 = Gest(mes)
plot(G2)
## lty col key label meaning
## km 1 1 km hat(G)[km](r) Kaplan-Meier estimate of G(r)
## rs 2 2 rs hat(G)[bord](r) border corrected estimate of G(r)
## han 3 3 han hat(G)[han](r) Hanisch estimate of G(r)
## theo 4 4 theo G[pois](r) theoretical Poisson G(r)
For the Cataglyphis ants: At first, the observed value of G is higher than the theoretical value of G (from about 0 to 10 feet). This indicates that there are more nests in the vicinity of other nests than is expected by chance, suggesting clustering nearby the nests. However, as the radius increases to about 15 feet, the observed value of G becomes less than the theoretical value of G. This indicates that there are fewer nests in the vicinity of other nests than is expected by chance which suggests spatial regularity.
For the Messor ants: The observed value of G is less than the theoretical value of G for the most part. This indicates that there are fewer nests in the vicinity of other nexts than is expected, suggesting spatial regularity. At a distance of about 27 feet, the observed and theoretical values of G flip and demonstrate clustering of nests.
plot(Kcross(ants, "Cataglyphis", "Messor"))
## lty col key
## iso 1 1 iso
## trans 2 2 trans
## border 3 3 border
## theo 4 4 theo
## label
## iso hat(K[list(Cataglyphis, Messor)]^{ iso})(r)
## trans hat(K[list(Cataglyphis, Messor)]^{ trans})(r)
## border hat(K[list(Cataglyphis, Messor)]^{ bord})(r)
## theo { K[list(Cataglyphis, Messor)]^{ pois }}(r)
## meaning
## iso Ripley isotropic correction estimate of Kcross["Cataglyphis", "Messor"](r)
## trans translation-corrected estimate of Kcross["Cataglyphis", "Messor"](r)
## border border-corrected estimate of Kcross["Cataglyphis", "Messor"](r)
## theo theoretical Poisson Kcross["Cataglyphis", "Messor"](r)
Since the theoretical value of K is fairly equal to the observed value of K, we can say that the events are independent of each other. There is no evidence of inter-species clustering. Also, with distance, we tend to find more Messor nests than expected.
ANTS = unmark(ants)
plot(Gest(ANTS))
## lty col key label meaning
## km 1 1 km hat(G)[km](r) Kaplan-Meier estimate of G(r)
## rs 2 2 rs hat(G)[bord](r) border corrected estimate of G(r)
## han 3 3 han hat(G)[han](r) Hanisch estimate of G(r)
## theo 4 4 theo G[pois](r) theoretical Poisson G(r)
ANTS.model = ppm(ANTS, trend = ~1, interaction = Strauss(r = 100), rbord = 100)
ANTS.model
## Stationary Strauss process
##
## First order term:
## beta
## 0.0009962
##
## Interaction: Strauss process
## interaction distance: 100
## Fitted interaction parameter gamma: 0.8189
##
## Relevant coefficients:
## Interaction
## -0.1998
##
## For standard errors, type coef(summary(x))
The first-order term is about 0.000996 which represents the intensity of the proposal events. It is larger than the actual intensity (0.000226 points per square unit) so it suggests an inhibition process (because of the “thinning”). The interaction parameter is 0.8189 and as it is less than one, it also indicates an inhibition process. Thus, the presence of a nest at a given location makes it less likely that another nest will be nearby.