Learn R Programming

games (version 1.1.2)

predict.game: Predicted probabilities for strategic models

Description

Makes predicted probabilities from a strategic model.

Usage

"predict"(object, ...)
"predict"(object, newdata, type=c("outcome", "action"), na.action = na.pass, ...) "predict"(object, newdata, type=c("outcome", "action"), na.action = na.pass, ...) "predict"(object, newdata, type=c("outcome", "action"), na.action = na.pass, ...) "predict"(object, newdata, na.action = na.pass, n.sim = 1000, ...)

Arguments

object
a fitted model of class game.
...
other arguments, currently ignored.
newdata
data frame of values to make the predicted probabilities for. If this is left empty, the original dataset is used.
type
whether to provide probabilities for outcomes (e.g., L, RL, or RR in egame12) or for actions (e.g., whether 2 moves L or R given that 1 moved R).
na.action
how to deal with NAs in newdata
n.sim
number of simulation draws to use per observation for ultimatum models (see Details).

Value

A data frame of predicted probabilities.

Details

This method uses a fitted strategic model to make predictions for a new set of data. This is useful for cross-validating or for graphical analysis. For many uses, such as analyzing the marginal effect of a particular independent variable, the function predProbs will be more convenient.

In the ultimatum model, there is not an analytic expression for the expected value of Player 1's offer. Therefore, predicted values are instead generating via simulation by drawing errors from a logistic distribution. The number of draws per observation can be controlled via the n.sim argument. For replicability, we recommend seeding the random number generator via set.seed before using predict.ultimatum.

See Also

predProbs provides a more full-featured and user-friendly wrapper, including plots and confidence bands.