oprobit_dist.Rd
Fits and evaluates the ordinal probit model.
#---- 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, ...)
Numeric vector
Vector of thresholds
Maximum value for computing thresholds
Optional vector of initial parameters
Optional vector of sampling weights
Object of class fit_yjt_scaled
or fit_t_scaled
Number of digits used for rounding in summary
File name for the summary
to be sunk into
Further arguments to be passed
Vector or an object of fitted distribution depending on the called function
See oprobit_regression
for fitting a regression model in which
the response variable follows an ordinal probit model.
#############################################################################
# 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)