Learn R Programming

NeuralNetTools (version 1.3.1)

pred_sens: Predicted values for Lek profile method

Description

Get predicted values for Lek Profile method, used iteratively in lekprofile

Usage

pred_sens(mat_in, mod_in, var_sel, step_val, fun_in, resp_name)

Arguments

mat_in
data.frame of only the explanatory variables used to create model
mod_in
any model object with a predict method
var_sel
chr string of explanatory variable to select
step_val
number of values to sequence range of selected explanatory variable
fun_in
function defining the method of holding explanatory variables constant
resp_name
chr string of response variable names for correct labelling

Value

  • A data.frame of predictions and the sequence values of the selected explanatory variable

Details

Gets predicted output for a model's response variable based on matrix of explanatory variables that are restricted following Lek's profile method. The selected explanatory variable is sequenced across a range of values. All other explanatory variables are held constant at the value specified by fun_in.

See Also

lekprofile

Examples

Run this code
## using nnet

library(nnet)

data(neuraldat)
set.seed(123)

mod <- nnet(Y1 ~ X1 + X2 + X3, data = neuraldat, size = 5)

mat_in <- neuraldat[, c('X1', 'X2', 'X3')]
pred_sens(mat_in, mod, 'X1', 100, function(x) quantile(x, 0.5), 'Y1')

Run the code above in your browser using DataLab