partial_cor {randomForestVIP}R Documentation

Partial Correlations

Description

A list of data.frames and useful plots for user evaluations of correlations and partial correlations of predictors with a given response.

Usage

partial_cor(formula, data = NULL, model = lm, num_var, ...)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

a data frame containing the variables in the model. By default the variables are taken from the environment which the model is called from.

model

Model to use for extraction partial correlations. Possible model choices are lm, rpart, randomForest, and svm. Default is lm.

num_var

Optional integer argument for reducing the number of variables to the top 'num_var'. Should be an integer between 1 and the total number of predictor variables in the model or it should be a positive proportion of variables desired.

...

Additional arguments to be passed to model as needed.

Value

A list of data.frames and useful plots for user evaluations of partial correlations.

Examples

pcs <- partial_cor(Petal.Length ~ ., data = iris[-5], model = lm)
pcs$plot_y_part_cors

[Package randomForestVIP version 0.1.3 Index]