**Exercise 1: Multi-Distance Spatial Cluster Analysis (Ripley’s K)**

**Questions **

How is the spatial presence of postfire woodpecker nests related to the spatial presence of salvage-logged forest stands?

- How are woodpecker nests clustered within survey units? (Exercise 1 and 3)
- How does this clustering relate to salvage treatment units within the survey units? (Exercise 2 and 3)

**Tool**

*Multi-Distance Spatial Cluster Analysis (Ripley’s K) in R*

Multi-Distance Spatial Cluster Analysis (Ripley’s K) analyzes point data clustering over a range of distances. Ripley’s K indicates how spatial clustering or dispersion changes with neighborhood size. If the user specifies distances to evaluate, starting distance, or distance increment, Ripley’s K identifies the number of neighboring features associated with each point if the neighboring features are closer than the distance being evaluated. As the evaluation distance increases, each feature will typically have more neighbors. If the average number of neighbors for a particular evaluation distance is higher/larger than the average concentration of features throughout the study area, the distribution is considered clustered at that distance.

Referenced from ArcGIS Desktop 9.3 Help (http://resources.esri.com/help/9.3/arcgisdesktop/com/gp_toolref/spatial_statistics_tools/how_multi_distance_spatial_cluster_analysis_colon_ripley_s_k_function_spatial_statistics_works.htm)

**Data ****Description**

My polygon dataset includes 10 survey units (6 treatment, 4 control) totaling over 7,000 ac. Each survey unit is between 397 and 1154 ac^{2}. 34 salvage logging units are dispersed throughout the 6 treatment units. The salvage units are characterized by three silvicultural prescriptions replicating preferred postfire habitat for the three target woodpecker species: black-backed, white-headed, and Lewis’s woodpeckers. The 4 control survey units and the unlogged landscape in the 6 treatment units act as the undisturbed control habitat.

In 2016 and 2017, belt transects with corresponding avian point counts were surveyed in each of the 10 survey units. These surveys detected woodpecker occupancy and nest locations based on audio playback and nest searching methodology. Woodpecker nest datasets were developed from these surveys for pre-salvage (2016, n = 71) and post-salvage (2017, n = 77) conditions. I wanted to run Ripley’s K on the two datasets separately to determine differences in nest clustering before and after the salvage treatments. In the future, with successive datasets collected in 2018 and 2019, I can analyze clustering trends up to three years after salvage logging. I will also integrate 3D forest structure variables from pre- and post-salvage lidar datasets.

A subset of the 2016 and 2017 nest datasets picturing clockwise from top right: East Fork Canyon Creek (Ctrl), Wall Creek (Ctrl), Alder Gulch (Trt), Lower Fawn Springs (Trt), Upper Fawn Springs (Trt).

By using Exercise 1 to determine how nests are clustered within the study units, I can use this clustering to inform my Exercises 2 and 3, which should reveal how the clustering relates to the salvage harvest units.

**Ripley’s K Steps**

- Export nest points as their own shapefile. My preliminary point dataset includes both nest points and vegetation survey points, so I needed to isolate only nest points. This will indicate how nest points cluster within study units.
- Further export nest points by survey unit. Isolate nests in each survey unit as their own shapefiles. Running Ripley’s K on 2016 and 2017 nests as a whole will not be useful, since clustering across an entire nest dataset will reflect the 10 survey units selected for this study. In that case, Ripley’s K would falsely demonstrate high clustering within those 10 survey units. In reality, the nests are only clustered here because the surveys intentionally restricted nest detection to these areas instead of across the entire Canyon Creek fire complex. I ran Ripley’s K on all the 2016 and 2017 nests and the output proved true to this phenomenon, indicating statistically significant clustering at smaller distances:

- Use R to run Ripley’s K on each survey unit’s 2016 nest shapefile.
- Use R to run Ripley’s K on each survey unit’s 2017 nest shapefile.

Below is the example script for Ripley’s K using the 2016 Alder Gulch survey unit. For 2017 I changed the variable names to 2017:

library(spatstat)

library(rgdal)

library(maptools)

library(ggplot2)

library(sp)

library(nlme)

library(rpart)

library(readxl)

library(raster)

setwd(“N:/AIS_Blue/Woodpeckers”)

getwd()

AGnests2016 <- readOGR(“./data”, layer = “AG_2016_nests”)

plot(AGnests2016)

class(AGnests2016)

AGnests2016.ppp <- as(AGnests2016,”ppp”)

n <- 100

AGnests2016RK <- envelope(AGnests2016.ppp, fun= Kest, nsim=n, verbose=F)

plot(AGnests2016RK)

I gave the option to run either 100 or 1000 iterations. The difference is that the confidence interval (grey area in the output graphs) widened with 1000 iterations, shown below for the Big Canyon survey unit:

Below are the Ripley’s K results for each survey unit in 2016 and 2017 over 100 iterations. The accompanying visual plots display nest point distribution in each survey unit. Some survey units did not have large enough sample sizes for the tool to function correctly. Notable results from a visual analysis of each graph include nest clustering in Big Canyon (Treatment 1) and Crawford Gulch (Control) in 2016 and Lower Fawn Creek (Treatment 2) in 2017.

**Alder Gulch 2016 (n = 5)**

**Alder Gulch 2017 (n = 7)**

______________________________________________________________________________________________________________________________________

**Big Canyon 2016 (n = 13)**

**Big Canyon 2017 (n = 10)**

______________________________________________________________________________________________________________________________________

**Crazy Creek 2016 (n = 10)**

**Crazy Creek 2017 (n = 11)**

______________________________________________________________________________________________________________________________________

**Crawford Gulch 2016 (n = 12)**

**Crawford Gulch 2017 (n = 8)**

**East Fork Canyon Creek 2016 (n = 3); Not surveyed in 2017**

**Lower Fawn Creek 2016 (n = 8)**

**Lower Fawn Creek 2017 (n = 14)**

**Overholt Creek 2017 (n = 4); Not surveyed in 2016**

**Sloan Gulch 2016 (n = 7)**

**Sloan Gulch 2017 (n = 7)**

**Upper Fawn Creek 2016 (n = 4)**

**Upper Fawn Creek 2017 (n = 5)**

**Wall Creek 2016 (n = 9)**

**Wall Creek 2017 (n = 11); **Cannot import figures due to unresolved maximum file size error.

**Problems/Critique**

Because of the small sample size for each of the survey units (as few as 4 nests in some years/units), my Ripley’s K output graphs appeared blocky instead of continuous. Notice how continuous the graphs appeared when I ran all 2016 nests. Overall this analysis did not perform well with these datasets. I am also unclear how edge effects were factored into this particular analysis. There may be more parameters I could define in the code when running this analysis in R. For example, I did not manually specify distances in the R code.

Ripley’s K requires (X,Y) coordinates for each point location. I first tried to perform this analysis in ArcMap. However, my woodpecker nest point shapefiles contain UTM coordinates divided into two separate fields for northing and easting. This caused a problem when the Ripley’s K tool in ArcMap asked for the dependent variable and I could only select one field, northing or easting. Therefore, I needed to run the Ripley’s K tool in RStudio instead.

The above Step 2 explains another issue with trying to analyze all nests at once, but I was able to resolve it by individually isolating each survey unit. Nest dataset analyses must also address a temporal component related to the salvage logging. 2016 nests must be analyzed separately from 2017-2019 nests, but 2017-2019 nests can be analyzed either by year or as a group.