summary(lansing) #returns summary stats for the dataset
## Marked planar point pattern: 2251 points
## Average intensity 2251 points per square unit (one unit = 924 feet)
##
## *Pattern contains duplicated points*
##
## Coordinates are given to 3 decimal places
## i.e. rounded to the nearest multiple of 0.001 units (one unit = 924 feet)
##
## Multitype:
## frequency proportion intensity
## blackoak 135 0.05997335 135
## hickory 703 0.31230560 703
## maple 514 0.22834300 514
## misc 105 0.04664594 105
## redoak 346 0.15370950 346
## whiteoak 448 0.19902270 448
##
## Window: rectangle = [0, 1] x [0, 1] units
## Window area = 1 square unit
## Unit of length: 924 feet
str(lansing) #returns the structure of the dataset
## List of 6
## $ window :List of 4
## ..$ type : chr "rectangle"
## ..$ xrange: num [1:2] 0 1
## ..$ yrange: num [1:2] 0 1
## ..$ units :List of 3
## .. ..$ singular : chr "foot"
## .. ..$ plural : chr "feet"
## .. ..$ multiplier: num 924
## .. ..- attr(*, "class")= chr "unitname"
## ..- attr(*, "class")= chr "owin"
## $ n : int 2251
## $ x : num [1:2251] 0.078 0.076 0.051 0.015 0.03 0.102 0.135 0.121 0.04 0.065 ...
## $ y : num [1:2251] 0.091 0.266 0.225 0.366 0.426 0.474 0.498 0.489 0.596 0.608 ...
## $ markformat: chr "vector"
## $ marks : Factor w/ 6 levels "blackoak","hickory",..: 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, "class")= chr "ppp"
names(lansing) #returns names of callable elements of the dataset
## [1] "window" "n" "x" "y" "markformat"
## [6] "marks"
mytest <- quadrat.test(ants)
## Warning: Some expected counts are small; chi^2 approximation may be inaccurate
plot(mytest)

Question 1: It has 97 points in three columns: x, y, Marked.
ants
## Marked planar point pattern: 97 points
## Multitype, with levels = Cataglyphis, Messor
## window: polygonal boundary
## enclosing rectangle: [-25, 803] x [-49, 717] units (one unit = 0.5 feet)
Question 2: They are marked, and the marks represent the
species/type of ant.
Question 3: Because the p-value is much greater than 0.05, I would
accept it.
ques3res <- quadrat.test(ants, nx=3, ny=3)
## Warning: Some expected counts are small; chi^2 approximation may be inaccurate
ques3res
##
## Chi-squared test of CSR using quadrat counts
##
## data: ants
## X2 = 7.5508, df = 8, p-value = 0.9571
## alternative hypothesis: two.sided
##
## Quadrats: 9 tiles (irregular windows)
Question 4:

Question 5: for cataglyphis ants I got a p-value of 0.6071 and for
messor ants I got a p-value of 0.7553, and would accept both of
these.
cataglyphis_ants <- subset(ants, marks == "Cataglyphis")
messor_ants <- subset(ants, marks == "Messor")
cataglyphis_test <- quadrat.test(cataglyphis_ants, nx = 3, ny = 3)
## Warning: Some expected counts are small; chi^2 approximation may be inaccurate
messor_test <- quadrat.test(messor_ants, nx = 3, ny = 3)
## Warning: Some expected counts are small; chi^2 approximation may be inaccurate
cataglyphis_test
##
## Chi-squared test of CSR using quadrat counts
##
## data: cataglyphis_ants
## X2 = 5.5594, df = 8, p-value = 0.6071
## alternative hypothesis: two.sided
##
## Quadrats: 9 tiles (irregular windows)
messor_test
##
## Chi-squared test of CSR using quadrat counts
##
## data: messor_ants
## X2 = 6.2221, df = 8, p-value = 0.7553
## alternative hypothesis: two.sided
##
## Quadrats: 9 tiles (irregular windows)
Question 6: the observation falls in between the envelope,
suggestion there it is random.
## 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, 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.

Question 7: There is a common trend with all of their observations
falling below the envelope, suggesting a high distance between these
groups.
Question 8: Most of the observations for all plots fall within the
envelope or just above it - which could mean the species have some
clustering together.
g_env_ants <- envelope(ants, Gcross, nsim = 99, i = "Cataglyphis", j = "Messor")
## 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.
k_env_ants <- envelope(ants, Kcross, nsim = 99, i = "Cataglyphis", j = "Messor")
## 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.
pcf_env_ants <- envelope(ants, pcfcross, nsim = 99, i = "Cataglyphis", j = "Messor")
## 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(g_env_ants, main = "Gcross: Cataglyphis to Messor")

plot(k_env_ants, main = "Kcross: Cataglyphis to Messor")

plot(pcf_env_ants, main = "pcfcross: Cataglyphis to Messor")

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)

Question 9: There is some deviation from the null from 0-20 meters,
and around evey 10 meters after you pass 20 there is a spike where there
is little/no deviation.
Question 10: It suggests a negative association between the
two.
Question 11: This is showing that trees of different sizes are in
clusters. Likely that between larger trees smaller ones are using the
space inbetween them.
## 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.

Question 12: From 0-15 meters the line is <1, and is a negative
correlation suggestion the anemones are of different sizes in that area,
and from meters 15+ the line remains near 1, if anything still just
slightly below it, meaning there is little to no correlation if size and
place of anemones. This could be happening because of the avalibility of
resources, sunlight, etc. causing larger/older anemones having a random
distribution but with clusters of saller/younger ones nearby because of
avalibilty.