Learn R Programming

predcomps (version 0.1)

GetPredCompsDF: GetApcDF

Description

makes average predictive comparison for all specified inputs

Usage

GetPredCompsDF(model, df, inputVars = NULL, ...)

Arguments

model
Either a function (from a data frame to vector of predictions) or a model we know how to deal with (lm, glm)
df
data frame with data
inputVars
inputs to the model
...
extra parguments passed to GetPairs used to control Weight function

Examples

Run this code
n <- 200
x1 <- runif(n = n, min = 0, max = 1)
x2 <- runif(n = n, min = 0, max = 1)
x3 <- runif(n = n, min = 0, max = 10)
y <- 2 * x1 + (-2) * x2 + 1 * x3 + rnorm(n, sd = 0.1)
df <- data.frame(x1, x2, x3, y)
fittedLm <- lm(y ~ ., data = df)
apcDF <- GetPredCompsDF(fittedLm, df = df)
apcDF

Run the code above in your browser using DataLab