oprobit_dist | R Documentation |
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 class 'fit_oprobit' coef(object, ...) ## S3 method for class 'fit_oprobit' logLik(object, ...) ## S3 method for class 'fit_oprobit' summary(object, digits=4, file=NULL, ...) ## S3 method for class 'fit_oprobit' vcov(object, ...)
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 |
digits |
Number of digits used for rounding in |
file |
File name for the |
... |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.