rvi.plot: Relative Variable Importance

Description Usage Arguments Details Value Examples

View source: R/rvi_plot.R

Description

Creates model selection tables, calculates and plots relative variable importance based on the scale level of a given model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
rvi.plot(
  formula,
  family,
  data,
  coord,
  maxlevel,
  detail = TRUE,
  wavelet = "haar",
  wtrafo = "dwt",
  n.eff = NULL,
  trace = FALSE,
  customize_plot = NULL
)

Arguments

formula

A model formula

family

gaussian, binomial, and poisson are supported.

data

A data frame or set of vectors of equal length.

coord

X,Y coordinates for each observation. Coordinates should be consecutive integers.

maxlevel

An integer for maximum scale level

detail

Remove smooth wavelets? If TRUE, only detail components are analyzed. If set to FALSE, smooth and detail components are analyzed. Default is TRUE.

wavelet

Type of wavelet: haar, d4, or la8

wtrafo

Type of wavelet transform: dwt or modwt

n.eff

A numeric value of effective sample size

trace

Should R print progress updates to the console? Default is FALSE

customize_plot

Additional plotting parameters passed to ggplot. NOW DEPRECATED.

Details

Calculates the relative importance of each variable using multi-model inference methods in a wavelet multi-resolution regression framework implemented in mmiWMRR. The scale level dependent results are then graphically displayed.

Value

A list containing

1. A matrix containing the relative importance of each variable in the regression at each value of the scale level.

2. A ggplot object containing a plot of the relative variable importance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
data(carlinadata)
coords<- carlinadata[,4:5]

## Not run: 

wrm <- WRM(carlina.horrida ~ aridity + land.use,
           family = "poisson",
           data = carlinadata,
           coord = coords,
           level = 1,
           wavelet = "d4")

mmi <- mmiWMRR(wrm, data = carlinadata, scale = 3, detail = TRUE)


# Plot scale-dependent relative variable importance
rvi <- rvi.plot(carlina.horrida ~ aridity + land.use,
                family = "poisson",
                data = carlinadata,
                coord = coords,
                maxlevel = 4,
                detail = TRUE,
                wavelet = "d4")

rvi$plot
rvi$rvi


## End(Not run)

Example output

         level=1 level=2 level=3 level=4
aridity    0.005       1       1       1
land.use   1.000       1       1       0

spind documentation built on Jan. 13, 2021, 6:04 p.m.