Recap and Introduction: Univariate Point Pattern Analysis

mytest <-quadrat.test(ants)
## Warning: Some expected counts are small; chi^2 approximation may be inaccurate
plot(mytest)

summary(ants)
## Marked planar point pattern:  97 points
## Average intensity 0.0002261486 points per square unit (one unit = 0.5 feet)
## 
## Coordinates are integers
## i.e. rounded to the nearest unit (one unit = 0.5 feet)
## 
## Multitype:
##             frequency proportion    intensity
## Cataglyphis        29  0.2989691 6.761144e-05
## Messor             68  0.7010309 1.585372e-04
## 
## Window: polygonal boundary
## single connected closed polygon with 11 vertices
## enclosing rectangle: [-25, 803] x [-49, 717] units
##                      (828 x 766 units)
## Window area = 428922 square units
## Unit of length: 0.5 feet
## Fraction of frame area: 0.676

1. What does the ants data consist of and how many points are there?

It consists of a polygon that is divided with horizontal and vertical lines to make 21 smaller areas, and within the smaller areas are data points of different numbers. There are 97 points.

2. Is it marked, and, if so, what do the marks represent?

Yes, I ran the summary(ants) code chunk and it returned data saying that there was a marked planar point pattern of 97 points. The marks add context, and in this instance 29 of the points represent Cataglyphis ants and 68 represent Messor ants.

3. Based on your Chi-square test, would you accept or reject Ho?

My p-value was 0.5417, which is not a significant outcome, so I would accept the null hypothesis that the results are most likely random.

4. Make a histogram of the residuals from mytest

hist(mytest$residuals)

5. Conduct Chi-squared tests for each species of ant separately. Report and interpret your P-values.

ants_split <- split(ants)
quadrat.test(ants_split$Cataglyphis)
## Warning: Some expected counts are small; chi^2 approximation may be inaccurate
## 
##  Chi-squared test of CSR using quadrat counts
## 
## data:  ants_split$Cataglyphis
## X2 = 33.133, df = 23, p-value = 0.1575
## alternative hypothesis: two.sided
## 
## Quadrats: 24 tiles (irregular windows)

The p-value for the Cataglyphis ants is 0.1575, which is not a significant outcome, so I would accept the null hypothesis that the results are most likely random.

ants_split <- split(ants)
quadrat.test(ants_split$Messor)
## Warning: Some expected counts are small; chi^2 approximation may be inaccurate
## 
##  Chi-squared test of CSR using quadrat counts
## 
## data:  ants_split$Messor
## X2 = 15.153, df = 23, p-value = 0.2219
## alternative hypothesis: two.sided
## 
## Quadrats: 24 tiles (irregular windows)

The p-value for the Messor ants is 0.2219, which is not a significant outcome, so I would accept the null hypothesis that the results are most likely random.

6. Perform this analysis for the ants data (ignoring species) and plot the result. You can do this exactly as you did for cells in Lab 3. What would you conclude from this result?

G_env <- envelope(ants, Gest, nsim = 95, alpha = 0.05)
## Generating 95 simulations of CSR  ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
## 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
## 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 
## 95.
## 
## Done.
plot(G_env)

The data stays in the bounds of the confidence band which means that the observed nearest-neighbor distances between the ants is consistent with Complete Spatial Randomness.

Multi-type and Bivariate Point Pattern Analysis

envelope(lansing, Gcross, nsim = 99, i = 'maple', j = 'hickory') |> plot()
## Generating 99 simulations of CSR  ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
## 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
## 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 
## 99.
## 
## Done.

envelope(lansing, Kcross, nsim = 99, i = 'maple', j = 'hickory') |> plot()
## Generating 99 simulations of CSR  ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
## 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
## 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 
## 99.
## 
## Done.

envelope(lansing, pcfcross, nsim = 99, i = 'maple', j = 'hickory') |> plot()
## Generating 99 simulations of CSR  ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
## 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
## 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 
## 99.
## 
## Done.

7. Run the above code and interpret the results. What do these three graphs tell you? Do they all give a consistent message?

Gcross: The lab tells me that the value of Gij(r) at a distance r is the probability that a randomly chosen point of type i has its nearest neighbor of type j within a distance r. After running the code, I see that the black line is below the grey envelope which means that the maple trees have hickory trees (neighbors) that are on average father away than expected under independence. This suggests a cross-type repulsion.

Kcross: The observed Kijr(r) curve is below the grey envelope, which suggests that hickories are on average more spread out from maple tree points than they would be by chance. This suggests a negative spatial association or repulsion between maple trees and hickory trees.

pcfcross: The black line is below the grey envelope which suggests that gij(r) < 1, which means that maple trees and hickory trees are repelling each other. Overall, all three graphs tell me that maple and hickory trees have a negative spatial association with each other.

8. Modify this for the ants data to evaluate whether ant nests of the two different species are random, over-, or under-dispersed. Interpret your results.

envelope(ants, Gcross, nsim = 99, i = 'Cataglyphis', j = 'Messor') |> plot()
## Generating 99 simulations of CSR  ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
## 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
## 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 
## 99.
## 
## Done.

envelope(ants, Kcross, nsim = 99, i = 'Cataglyphis', j = 'Messor') |> plot()
## Generating 99 simulations of CSR  ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
## 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
## 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 
## 99.
## 
## Done.

envelope(ants, pcfcross, nsim = 99, i = 'Cataglyphis', j = 'Messor') |> plot()
## Generating 99 simulations of CSR  ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
## 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
## 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 
## 99.
## 
## Done.

Gcross: The black line is within the grey envelope which means that the spatial arrangement of Messor ants and Cataglyphis ants is consistent with independence. This means there is no apparent attraction or repulsion.

Kcross: The observed Kijr(r) curve is inside the grey envelope, which suggests that the locations of Messor ants and Cataglyphis ants are spatially independent of each other.

pcfcross: The black line is inside the grey envelope which suggests that gij(r) = 1. This means that Messor ants and Cataglyphis ants are independent of one another at distance r. Overall, all three tests show me that the two ant species have a neutral spatial association.

E <- envelope(longleaf, markcorr, nsim=99)
## Generating 99 simulations of CSR  ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
## 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
## 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 
## 99.
## 
## Done.
plot(E)

9. Does there appear to be a deviation from the null expectation? If so, at what distances?

There is a deviation from the null expectation (1) from 0-18 meters and then again from 19-50 meters.

10. Does the deviation suggest positive or negative association?

The deviation is when the black line is below the bands of the grey envelope and below 1, which indicates a negative association. This means that trees with different diameters tend to be found close to one another.

11. What does this mean vis a vis the question of whether trees tend to be near other trees of similar size, or whether they tend to be near trees of different sizes.

The null expectation is that the locations of trees are independent of diameter. Since the observed data is below 1 except for around 18-19 meters, I can interpret that large trees are near small trees more often than two large or two small trees are near each other.

12. Perform a similar analysis with the anemones dataset and interpret the resulting output. What does this tell you about the relationships between distance from nearest neighbors and size in sea-anemones? Construct a hypothesis that would explain the relationship, i.e. what might lead to a pattern like this?

E <- envelope(anemones, markcorr, nsim=99)
## Generating 99 simulations of CSR  ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
## 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
## 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 
## 99.
## 
## Done.
plot(E)

The resulting output is pretty similar to the longleaf dataset output. The null expectation is that the size of a sea-anemone is independent of the size of another sea-anemone. Since the observed data is below 1 except for around 18-19 meters, I can interpret that large trees are near small trees more often than two large or two small trees are near each other 15r, 28r, 36r and 46r, I can conclude that there is a negative association, and sea-anemones of different sizes tend to be closer to another another than those of similar sizes. I hypothesis that this negative association may be caused by a fight for resources, meaning that large sea-anemones take more essential nutrients for survival, leaving few for the rest and stunting growth of the smaller sea-anemones.