predict.dbchoice: Predicting model for dbchoice

View source: R/predict.dbchoice.R

predict.dbchoiceR Documentation

Predicting model for dbchoice

Description

Predicting method for objects of class "dbchoice".

Usage

## S3 method for class 'dbchoice'
predict(object, newdata = NULL, type = c("utility", "probability"), 
bid = NULL, ...)

Arguments

object

an object of class "dbchoice".

newdata

a data frame containing new data to predict. If NULL, the original data is used.

type

type of prediction (utility or probability).

bid

a bid design needed to predict with original data.

...

optional arguments. Currently not in use.

Details

The function predict() for S3 object "dbchoice" calculates predicted values according to the fitted model that is included in object. The values are predicted with the original data used for fitting the model if newdata = NULL, otherwise with a new data assigned to newdata. There are two notes for dbchoice(): a bid design used for the fit must be assigned to bid, when predicting with the original data; the predicted values are calculated according to the relevant single-bounded dichotomous choice model, when predicting with a new data. See examples for details.

The current function does not estimate standard errors of predicted values.

Value

When newdata = NULL and type = utility, a matrix containing utility values under first (f), second upper (u), and second lower (l) bids is returned. When newdata = NULL and type = probability, a matrix containing probabilities of choosing Yes-Yes (yy), No-No (nn), Yes-No (yn), and No-Yes (ny) is returned. When a new data is assigned to newdata, predictions are calculated according to the relevant single-bounded dichotomous choice model, and a vector containing utility values of choosing yes (type = utility) or probability of choosing yes (type = probability) is returned.

See Also

dbchoice

Examples

## See Examples in dbchoice.

DCchoice documentation built on July 26, 2023, 6:11 p.m.