Learn R Programming

mdmb (version 1.9-22)

oprobit_dist: Ordinal Probit Models

Description

Fits and evaluates the ordinal probit model.

Usage

#---- ordinal probit model
doprobit(x, thresh, max_val=99)

fit_oprobit(x, par_init=NULL, weights=NULL) # S3 method for fit_oprobit coef(object, ...) # S3 method for fit_oprobit logLik(object, ...) # S3 method for fit_oprobit summary(object, digits=4, file=NULL, ...) # S3 method for fit_oprobit vcov(object, ...)

Value

Vector or an object of fitted distribution depending on the called function

Arguments

x

Numeric vector

thresh

Vector of thresholds

max_val

Maximum value for computing thresholds

par_init

Optional vector of initial parameters

weights

Optional vector of sampling weights

object

Object of class fit_yjt_scaled or fit_t_scaled

digits

Number of digits used for rounding in summary

file

File name for the summary to be sunk into

...

Further arguments to be passed

See Also

See oprobit_regression for fitting a regression model in which the response variable follows an ordinal probit model.

Examples

Run this code
#############################################################################
# EXAMPLE 1: Fit an ordinal probit distribution
#############################################################################

#-- simulate data
set.seed(987)
N <- 1500
# define thresholds
thresh <- c(0,.3, .7, 1.6)
# latent continuous data
yast <- stats::rnorm(N)
# discretized ordinal data
x <- as.numeric( cut( yast, c(-Inf,thresh,Inf) ) ) - 1

#-- fit ordinal probit distribution
mod <- mdmb::fit_oprobit(x=x)
summary(mod)
logLik(mod)
vcov(mod)

Run the code above in your browser using DataLab