predict.mnprobit {switchSelection} | R Documentation |
Predict method for mnprobit function
Description
Predict method for mnprobit function
Usage
## S3 method for class 'mnprobit'
predict(
object,
...,
newdata = NULL,
alt = 1,
regime = -1,
type = ifelse(is.null(regime) | (regime == -1), "prob", "val"),
alt_obs = "all",
me = NULL,
eps = NULL,
control = list(),
se = FALSE
)
Arguments
object |
object of class "mnprobit" |
... |
further arguments (currently ignored) |
newdata |
an optional data frame in which to look for variables with which to predict. If omitted, the original data frame used. This data frame should contain values of dependent variables even if they are not actually needed for prediction (simply assign them with 0 values). |
alt |
index of the alternative. See 'Details' for more information. |
regime |
regime of the continuous equation. See 'Details' for more information. |
type |
string representing a type of prediction. See 'Details' for more information. |
alt_obs |
if |
me |
string representing the name of the variable for which marginal effect should be estimated. See 'Details' for more information. |
eps |
numeric vector of length 1 or 2 used for calculation of marginal effects. See 'Details'. |
control |
list of additional arguments. Currently is not intended for the users. |
se |
logical; if |
Details
See 'Examples' section of mnprobit
for examples of this function application.
If type = "prob"
then function returns a probability that
alternative alt
will be chosen. For example if alt = 2
then
probabilities P(z_{i} = 2|w_{i})
will be estimated.
If n_alt
is null then the function returns a matrix such that
i
-th column contains probability of selecting i
-th alternative.
If type = "li"
then function returns a matrix which columns are
linear indexes of corresponding equations.
If type = "val"
then function returns predictions of conditional
(on group
) expectation of dependent variable in continuous equation
with regimes determined by regime
argument. To predict unconditional
expectations just set alt = NULL
.
If type = "lambda"
then function returns conditional
(on alt
) expectation of random error of continuous equation
in regime regime
.
If me
is provided then the function returns marginal effect
of variable me
respect to the statistic determined by type
argument.
For example if me = "x1"
and type = "prob"
then function
returns a marginal effect of x1
on the corresponding probability
i.e. one that would be estimated if me
is NULL
.
If length(eps) = 1
then eps
is an increment in
numeric differentiation procedure.
If eps
is NULL
then this increment will be selected
automatically taking into account scaling of variables.
If length(eps) = 2
then marginal effects will be estimated as the
difference between predicted value when variable me
equals
eps[2]
and when it equals eps[1]
correspondingly.
Value
This function returns predictions for each row of newdata
or for each observation in the model if newdata
is NULL
.
Structure of the output depends on the type
argument
(see 'Details' section).