predict.dbchoice: Predicting model for dbchoice

Description Usage Arguments Details Value See Also Examples

View source: R/predict.dbchoice.R

Description

Predicting method for objects of class "dbchoice".

Usage

1
2
3
## 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

1
## See Examples in dbchoice.

Example output

Loading required package: MASS
Loading required package: interval
Loading required package: survival
Loading required package: perm
Loading required package: Icens
Loading required package: MLEcens
Loading required package: Formula

DCchoice documentation built on May 2, 2019, 4:44 p.m.