1.

From bottom to top, left to right, row 2, column 2 and row 2, column 3 are the two cells with the lowest density.

2.

The highest point density contour is at 0.024

3.

The lowest resulting value is 0, and a resulting p value of less than 2.2e-16 is evidence to reject the null hypothesis.

4.

The following code has been edited to show quintiles:

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 ="+")
quadcount <- quadratcount(bei, tess=V)
plot(quadcount)
quadrat.test(bei, tess=V)

5.

The breaks are 0%, 0.0008663357; 20%, 0.0351263200; 40%, 0.0531477800; 60%, 0.0780709100; 80%, 0.1287942000; and 100%, 0.3284767000

6.

The number of points in each quintile are 210, 654, 762, 911, and 1067.

7.

Yes, slope seems to be better at explaining the non-random distribution of points in the bei data.

8.

The dashed line represents the probablity of there being a tree at any given slope if the distribution were random.

9.

The plot suggests that trees are more likely to exist at higher slopes up until a critical steepness where they then dip down.

10.

The variables that appear significant are slope and the interaction between slop and elevation.

11.

In comparing the results, I find that they are strikingly similar (the numbers for each variable vary only slightly between the two) and each variable that was significant in the slrm were significant in the ppm.

12.

There are a total of 150 sites in this reduced data set.

13.

Yes, a chi squared value of 183.29 and a p value of less than 2.2e-16 suggests that there is a nonrandom distribution across vegetation types. Primary has the highest number of nests at 120.

14.

No, a p-value of 0.8109 suggests that we fail to reject the null hypothesis that there is a random distribution of nests across slope-type. The Ridge slope type has the highest number of nests at 58.

15.

slope_angle <- quantile(gorillas.extra$slopeangle, probs=(0:5)/5)
slope_angle_cut <- cut(gorillas.extra$slopeangle, breaks=slope_angle, labels=1:5)
SAC <- tess(image=slope_angle_cut)
quadrat.test(gor_subset, tess=SAC)

Given a p value of 0.03356, we would likely reject the null hypothesis and determine that there is a non-random spatial relationship between the subset of nests and slope angle.

elevation <- quantile(gorillas.extra$elevation, probs=(0:5)/5)
elevation_cut <- cut(gorillas.extra$elevation, breaks=elevation, labels=1:5)
EC <- tess(image=elevation_cut)

Given a p value of less than 2.2e-16, we would confidently reject the null hypothesis and determine that there is a non-random spatial relationship between the subset of nests and elevation

16.

slopeangle <- gorillas.extra$slopeangle
elevation <- gorillas.extra$elevation
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 Ztest
## (Intercept) -17.802326729 0.5121349548 -18.806092795 -16.798560662   ***
## slopeangle    0.010935241 0.0041881722   0.002726575   0.019143908    **
## elevation     0.004078837 0.0002732855   0.003543208   0.004614467   ***
##                   Zval
## (Intercept) -34.761007
## slopeangle    2.610982
## elevation    14.925188
plot(model3)

This slrm model suggests that the higher the slope angles the more likely there are to be nests, and that the higher elevation there is the more likely there are to be nests. Both the slope angle and elevation are significant, with the elevation being moreso. When controlling for the other, the two variables’ effects are diminished, yet still significant.