# gwplot: Plot method for generalized weights

## Description

`gwplot`

, a method for objects of class `nn`

, typically produced
by `neuralnet`

. Plots the generalized weights (Intrator and Intrator,
1993) for one specific covariate and one response variable.

## Usage

gwplot(x, rep = NULL, max = NULL, min = NULL, file = NULL,
selected.covariate = 1, selected.response = 1, highlight = FALSE,
type = "p", col = "black", ...)

## Arguments

rep

an integer indicating the repetition to plot. If rep="best", the
repetition with the smallest error will be plotted. If not stated all
repetitions will be plotted.

max

maximum of the y axis. In default, max is set to the highest
y-value.

min

minimum of the y axis. In default, min is set to the smallest
y-value.

file

a character string naming the plot to write to. If not stated,
the plot will not be saved.

selected.covariate

either a string of the covariate's name or an
integer of the ordered covariates, indicating the reference covariate in the
generalized weights plot. Defaulting to the first covariate.

selected.response

either a string of the response variable's name or
an integer of the ordered response variables, indicating the reference
response in the generalized weights plot. Defaulting to the first response
variable.

highlight

a logical value, indicating whether to highlight (red
color) the best repetition (smallest error). Only reasonable if rep=NULL.
Default is FALSE

type

a character indicating the type of plotting; actually any of the
types as in `plot.default`

.

col

a color of the generalized weights.

…

Arguments to be passed to methods, such as graphical parameters
(see `par`

).

## References

Intrator O. and Intrator N. (1993) *Using Neural Nets for
Interpretation of Nonlinear Models.* Proceedings of the Statistical
Computing Section, 244-249 San Francisco: American Statistical Society
(eds.)

## Examples

# NOT RUN {
data(infert, package="datasets")
print(net.infert <- neuralnet(case~parity+induced+spontaneous, infert,
err.fct="ce", linear.output=FALSE, likelihood=TRUE))
gwplot(net.infert, selected.covariate="parity")
gwplot(net.infert, selected.covariate="induced")
gwplot(net.infert, selected.covariate="spontaneous")
# }