Learn R Programming

sampleSelection (version 1.2-12)

predict.probit: Predict method for fitted probit models

Description

Calculate predicted values for fitted probit models.

Usage

# S3 method for probit
predict( object, newdata = NULL, type = "link", ... )

Arguments

object

a fitted object of class probit.

newdata

optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors or the fitted response values are returned.

type

the type of prediction. If this argument is "link" (the default), the predicted linear predictors are returned. If this argument is "response", the predicted probabilities are returned.

further arguments (currently ignored).

Value

A numeric vector of the predicted values.

See Also

probit, predict, predict.glm, residuals.probit, and probit-methods.

Examples

Run this code
# NOT RUN {
## female labour force participation probability
data( "Mroz87" )
m <- probit( lfp ~ kids5 + kids618 + educ + hushrs +
   huseduc + huswage + mtr + motheduc, data=Mroz87 )
predict( m )                            # equal to linearPredictors(m)
predict( m, type = "response" )         # equal to fitted(m)
predict( m, newdata = Mroz87[ 3:9, ] )  # equal to linearPredictors(m)[3:9]
predict( m, newdata = Mroz87[ 3:9, ], type = "response" ) # equal to fitted(m)[3:9]
# }

Run the code above in your browser using DataLab