grnn.margin {yager} | R Documentation |
The function grnn.margin
derives the marginal effect of a predictor used in a GRNN
by assuming mean values for the rest predictors
grnn.margin(net, i, plot = TRUE)
net |
The GRNN object generated by grnn.fit() |
i |
The ith predictor in the GRNN |
plot |
TRUE or FALSE to plot the marginal effect |
A plot of the marginal effect or a dataframe of the marginal effect
data(iris, package = "datasets")
Y <- ifelse(iris[, 5] == "setosa", 1, 0)
X <- scale(iris[, 1:4])
gnet <- grnn.fit(x = X, y = Y)
grnn.margin(gnet, 1, plot = FALSE)