Problem 1

The quadrats located at (2, 2) and (2, 3) have the lowest density, with 49 and 17 trees respectively.

Problem 2

The highest contour is 0.024.

Problem 3

The lowest density value for a polygon is 0. The p-value upon conducting a quadrat test is well below 0.05, so I reject the null hypothesis.

Problem 4

slope <- bei.extra$grad
elev <- bei.extra$elev

b <- quantile(slope, probs = (0:5)/5)
slopecut <- cut(slope, breaks=b, labels=1:5)
V <- tess(image = slopecut)
plot(V)
plot(bei, add=T, pch ="+")

quadcount1 <- quadratcount(bei, tess=V)
plot(quadcount1)

quadrat.test(bei, tess=V)
## 
##  Chi-squared test of CSR using quadrat counts
## 
## data:  bei
## X2 = 587, df = 4, p-value < 2.2e-16
## alternative hypothesis: two.sided
## 
## Quadrats: 5 tiles (levels of a pixel image)
B <- quantile(elev, probs = (0:5)/5)
elevcut <- cut(elev, breaks=B, labels=1:5)
v <- tess(image = elevcut)
plot(v)
plot(bei, add=T, pch ="+")

quadcount2 <- quadratcount(bei, tess=v)
plot(quadcount2)

quadrat.test(bei, tess=v)
## 
##  Chi-squared test of CSR using quadrat counts
## 
## data:  bei
## X2 = 567.09, df = 4, p-value < 2.2e-16
## alternative hypothesis: two.sided
## 
## Quadrats: 5 tiles (levels of a pixel image)

Problem 5

The quintile breaks for slope are 0.0351263200, 0.0531477800, 0.0780709100, 0.1287942000, and 0.3284767000.

Problem 6

The number of points in each quadrat for elevation 490, 719, 861, 1174, and 360, in that order.

Problem 7

They seem to be about the same at explaining the non-random distribution of points in the bei data.

Problem 8

The dashed line in the plot represents the average tree density across the whole study area.

Problem 9

The plot suggests that more trees are found at areas with higher slopes.

Problem 10

Both elevation and slope appear to be significant in this model.

Problem 11

The coefficients obtained from ppm and slrm are rather similar, only varying by a few tenths of a point. The significance tests are different, but they do mostly tell you the same thing about your data, at least in this case.

Problem 12

There are 150 sites in this reduced data set.

Problem 13

It appears that there’s a non-random distribution of gorilla nests across vegetation types. The vegetation type with the highest number of nests is primary forest.

Problem 14

It appears that there is a potentially random distribution of gorilla nests across slope types. The slope type with the highest number of nests is the ridge.

Problem 15

A quadrat test for the slope type resulted in a p-value of 0.1909, so I would accept the null hypothesis and expect that it is a random distribution of nests across slope type. A quadrat test for the elevation resulted in a p-value < 2.2e-16, so I would reject the null hypothesis and expect that it is a non-random distribution of nests across elevation.

Problem 16

elevation <- gorillas.extra$elevation
slopeangle <- gorillas.extra$slopeangle
model3 <- slrm(gorillas ~ slopeangle*elevation)
summary(model3)
## Fitted spatial logistic regression model
## Call:    [1] "slrm(gorillas ~ slopeangle * elevation)"
## Formula: gorillas ~ slopeangle * elevation
## Fitted coefficients: 
##                           Estimate         S.E.       CI95.lo       CI95.hi
## (Intercept)          -2.332091e+01 1.263619e+00 -2.579755e+01 -2.084426e+01
## slopeangle            2.475413e-01 4.758177e-02  1.542828e-01  3.407999e-01
## elevation             7.141061e-03 6.905863e-04  5.787536e-03  8.494585e-03
## slopeangle:elevation -1.323112e-04 2.650176e-05 -1.842537e-04 -8.036875e-05
##                      Ztest       Zval
## (Intercept)            *** -18.455653
## slopeangle             ***   5.202441
## elevation              ***  10.340577
## slopeangle:elevation   ***  -4.992545
plot(model3)

Based on these results, I would say that slope angle and elevation together are not a great predictor of nest locations, though they can be helpful individually.