Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

foretell

Alternative to 'predict' returning values of correct type.


Description

Te default precict function doesn't always return the predicted variable by default. For example, when estimating a binomial model using glm, by default the log-odds are returned. foretell wraps predict while setting options so that the actual predicted value is returned.

Usage

foretell(object, ...)

## Default S3 method:
foretell(object, ...)

## S3 method for class 'glm'
foretell(object, newdata = NULL, type, ...)

## S3 method for class 'rpart'
foretell(object, newdata, type, ...)

Arguments

object

A model object,(lm, glm, ...)

...

Furher arguments passed to predict.

newdata

[data.frame] a data frame in which to look for variables with which to predict. For glmnet models this argument is mandatory.

type

[character] Type of output. If missing, the type of predicted variable is returned.


simputation

Simple Imputation

v0.2.6
GPL-3
Authors
Mark van der Loo [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.