vis.concurvity: Visualise concurvity between terms in a GAM

Description Usage Arguments Details Author(s) Examples

View source: R/vis.concurvity.R

Description

Plot measures of how much one term in the model could be explained by another. When values are high, one should consider re-running variable selection with one of the offending variables removed to check for stability in term selection.

Usage

1
vis.concurvity(model, type = "estimate")

Arguments

model

fitted model

type

concurvity measure to plot, see concurvity

Details

These methods are considered somewhat experimental at this time. Consult concurvity for more information on how concurvity measures are calculated.

Author(s)

David L Miller

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
library(Distance)
library(dsm)

# load the Gulf of Mexico dolphin data (see ?mexdolphins)
data(mexdolphins)

# fit a detection function and look at the summary
hr.model <- ds(distdata, max(distdata$distance),
               key = "hr", adjustment = NULL)

# fit a simple smooth of x and y to counts
mod1 <- dsm(count~s(x,y)+s(depth), hr.model, segdata, obsdata)

# visualise concurvity using the "estimate" metric
vis.concurvity(mod1)

## End(Not run)

Example output

Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-33. For overview type 'help("mgcv-package")'.
Loading required package: mrds
This is mrds 2.2.3
Built: R 4.0.3; ; 2020-11-21 12:02:24 UTC; unix
Loading required package: numDeriv
This is dsm 2.3.0
Built: R 4.0.3; ; 2020-11-24 09:14:04 UTC; unix

Attaching package:DistanceThe following object is masked frompackage:mrds:

    create.bins

Fitting hazard-rate key function
Key only model: not constraining for monotonicity.
AIC= 841.253
No survey area information supplied, only estimating detection function.

Warning message:
In ds(distdata, max(distdata$distance), key = "hr", adjustment = NULL) :
  Estimated hazard-rate scale parameter close to 0 (on log scale). Possible problem in data (e.g., spike near zero distance).

dsm documentation built on March 27, 2021, 9:07 a.m.