Learn R Programming

fastLogisticRegressionWrap (version 1.2.0)

predict.fast_logistic_regression: FastLR Wrapper Predictions

Description

Predicts returning p-hats

Usage

# S3 method for fast_logistic_regression
predict(object, newdata, type = "response", ...)

Value

A numeric vector of length nrow(newdata) of estimates of P(Y = 1) for each unit in newdata.

Arguments

object

The object built using the fast_logistic_regression or fast_logistic_regression_stepwise wrapper functions

newdata

A matrix of observations where you wish to predict the binary response.

type

The type of prediction required. The default is "response" which is on the response scale (i.e. probability estimates) and the alternative is "link" which is the linear scale (i.e. log-odds).

...

Further arguments passed to or from other methods

Examples

Run this code
library(MASS); data(Pima.te)
flr = fast_logistic_regression(
  Xmm = model.matrix(~ . - type, Pima.te), 
  ybin = as.numeric(Pima.te$type == "Yes")
)
phat = predict(flr, model.matrix(~ . - type, Pima.te))

Run the code above in your browser using DataLab