get_moran: Extract Moran's I test results for model residuals

View source: R/get_moran.R

get_moranR Documentation

Extract Moran's I test results for model residuals

Description

Extracts Moran's I test results for spatial autocorrelation in model residuals from models fitted with rf(), rf_repeat(), or rf_spatial().

Usage

get_moran(model)

Arguments

model

Model object from rf(), rf_repeat(), or rf_spatial().

Details

Moran's I tests for spatial autocorrelation in model residuals. Significant positive values indicate residuals are spatially clustered, suggesting the model hasn't fully captured spatial patterns. For spatial models (rf_spatial()), low or non-significant Moran's I values indicate successful removal of spatial autocorrelation.

Value

Data frame with Moran's I statistics at multiple distance thresholds. Columns include distance.threshold, moran.i (statistic), p.value, interpretation, and method.

See Also

moran(), moran_multithreshold(), plot_moran(), print_moran()

Other model_info: get_evaluation(), get_importance(), get_importance_local(), get_performance(), get_predictions(), get_residuals(), get_response_curves(), get_spatial_predictors(), print.rf(), print_evaluation(), print_importance(), print_moran(), print_performance()

Examples

data(plants_rf)

# Extract Moran's I test results
moran_results <- get_moran(plants_rf)
moran_results

# Check for significant spatial autocorrelation
significant <- moran_results[moran_results$p.value < 0.05, ]
significant


spatialRF documentation built on Dec. 20, 2025, 1:07 a.m.