Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

residualssurface

Show and Interpolate Two Dimensional Distribution of Residuals


Description

This function interpolates the spatial structure of residuals of a GLM through gam or surf.ls and optionally provides a graph.

Usage

residualssurface(model, data, x, y, gam = F, npol = 2, plotit = T, filled = F, bubble = F)

Arguments

model

Result of GLM as calculated by glm or glm.nb.

data

Data set that contains the spatial coordinates of the sample units used for the original model (specified as "x" and "y").

x

Horizontal position of the sample units.

y

Vertical position of the sample units.

gam

Interpolate the spatial structure by gam (if "TRUE") or by surf.ls (if "FALSE").

npol

Degree of polynomial surface as passed to surf.ls.

plotit

Plot the interpolated surface (through interp and the residuals) .

filled

Fill the contours by filled.contour.

bubble

Provide a bubble graph of the residuals: circles indicate positive residuals, whereas squares indicate negative residuals.

Details

The function reports the results of a GAM or least-squares trend surface analysis of the spatial distribution of residuals of a model (through residuals).

Optionally, a graph is produced that can contain the trend surface, filled contours and bubble graphs in addition to the spatial location of the sample units.

Value

The function reports the results of a GAM or least-squares trend surface analysis of the spatial distribution of residuals. Optionally, a graph is provided.

Author(s)

Roeland Kindt (World Agroforestry Centre)

References

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies.

Examples

library(vegan)
library(mgcv)
library(akima)
data(faramea)
Count.model1 <- lm(Faramea.occidentalis ~ Precipitation,
    data=faramea, na.action=na.exclude)
surface.1 <- residualssurface(Count.model1, na.omit(faramea),
    'UTM.EW', 'UTM.NS', gam=TRUE, plotit=TRUE, bubble=TRUE)

BiodiversityR

Package for Community Ecology and Suitability Analysis

v2.13-1
GPL-3
Authors
Roeland Kindt [cre, aut] (<https://orcid.org/0000-0002-7672-0712>)
Initial release
2021-4-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.