R/predict.oprobit_regression.R

Defines functions predict.oprobit_regression

Documented in predict.oprobit_regression

## File Name: predict.oprobit_regression.R
## File Version: 0.08

predict.oprobit_regression <- function( object, newdata=NULL, ...)
{
    if ( ! is.null(newdata) ){
        Xdes <- stats::model.matrix( object$formula, newdata )
        offset_values <- offset_values_extract(formula=object$formula, data=newdata )
    } else {
        Xdes <- object$X
        offset_values <- object$offset_values
    }
    beta <- object$coefficients[ object$index_beta ]
    linear_predictor <- Xdes %*% beta + offset_values
    return(linear_predictor[,1])
}
alexanderrobitzsch/mdmb documentation built on July 18, 2024, 11:14 p.m.