Title: | Multiple Ordinal Tobit (MOT) Model |
---|---|
Description: | Fit right censored Multiple Ordinal Tobit (MOT) model. |
Authors: | Marvin N. Wright |
Maintainer: | Marvin N. Wright <[email protected]> |
License: | GPL-3 |
Version: | 0.1.4 |
Built: | 2024-11-18 03:07:49 UTC |
Source: | https://github.com/cran/lmmot |
Fit right censored Multiple Ordinal Tobit (MOT) model.
lmmot(formula, data = sys.frame(sys.parent()), threshold, stdEr = "fisher", ...)
lmmot(formula, data = sys.frame(sys.parent()), threshold, stdEr = "fisher", ...)
formula |
Object of class formula describing the model. |
data |
Optional data frame or environment containing the variables in the model. |
threshold |
Vector of thresholds in the model. |
stdEr |
Method for standard error estimation. Use "fisher" for estimation using the inverse of the Fisher information matrix or "hessian" for estimation using the Hessian matrix. |
... |
Further arguments passed to the maximum likelihood estimation function maxLik. |
Fit right censored Multiple Ordinal Tobit (MOT) model. The model is a right censored Tobit model with multiple ordinal categories for latent values above the threshold, the threshold is therefore replaced by a threshold vector.
For the latent variable a linear model with independent and identically distributed non-systematic and homoscedastic errors is assumed.
If the threshold is of length 1, the model is equivalent to the standard right censored Tobit model.
The data is fitted with the Maximum Likelihood method.
lmmot object: maxLik object with additional fields:
censoring: Number of obeservations in the censoring intervals.
fisherInfo: Fisher information matrix.
stdEr: Standard errors for estimated coefficients.
tval: Value for t statistic in Wald test.
pval: p-value in Wald test.
fitted.values: Fitted values of the estimated model.
residuals: Residuals of the estimated model.
Marvin N. Wright
# Random data for x N <- 100 x <- rnorm(N, 25, 10) # Simulate data for latent variable ystar with simple linear model beta_0 <- 60 beta_1 <- 1 sigma <- 8 ystar <- beta_0 + beta_1*x + rnorm(N, 0, sigma) # Simulate censoring for observed variable y y <- ystar y[y >= 100] <- 100 y[(y >= 90) & (y < 100)] <- 90 y[(y >= 80) & (y < 90)] <- 80 # MOT regression with observed variable y mot.fit <- lmmot(y ~ x, threshold = c(80, 90, 100)) # Show details summary(mot.fit) # Compare real data with model fit plot(x, ystar) abline(coefficients(mot.fit)[1:2])
# Random data for x N <- 100 x <- rnorm(N, 25, 10) # Simulate data for latent variable ystar with simple linear model beta_0 <- 60 beta_1 <- 1 sigma <- 8 ystar <- beta_0 + beta_1*x + rnorm(N, 0, sigma) # Simulate censoring for observed variable y y <- ystar y[y >= 100] <- 100 y[(y >= 90) & (y < 100)] <- 90 y[(y >= 80) & (y < 90)] <- 80 # MOT regression with observed variable y mot.fit <- lmmot(y ~ x, threshold = c(80, 90, 100)) # Show details summary(mot.fit) # Compare real data with model fit plot(x, ystar) abline(coefficients(mot.fit)[1:2])
Fisher information matrix for right censored Multiple Ordinal Tobit (MOT) model.
motFisher(param, xx, tau)
motFisher(param, xx, tau)
param |
parameter vector: (beta_0, beta_1, ... , beta_m, sigma). |
xx |
design matrix of the model. |
tau |
threshold vector from tau_1 to tau_K. |
fisher information matrix, summarized over all observations.
Marvin Wright
Gradient of log-Likelihood for right censored Multiple Ordinal Tobit (MOT) model.
motGradient(param, xx, y, tau)
motGradient(param, xx, y, tau)
param |
parameter vector: (beta_0, beta_1, ... , beta_m, sigma). |
xx |
design matrix of the model. |
y |
observation vector. |
tau |
threshold vector from tau_1 to tau_K. |
gradient of log-likelihood, vector with all observations.
Marvin Wright
Hessian matrix of log-Likelihood for right censored Multiple Ordinal Tobit (MOT) model.
motHessian(param, xx, y, tau)
motHessian(param, xx, y, tau)
param |
parameter vector: (beta_0, beta_1, ... , beta_m, sigma). |
xx |
design matrix of the model. |
y |
observation vector. |
tau |
threshold vector from tau_1 to tau_K. |
hessian matrix, summarized over all observations.
Marvin Wright
Log-Likelihood for multiple ordinal right censored Multiple Ordinal Tobit (MOT) model.
motLogLik(param, xx, y, tau)
motLogLik(param, xx, y, tau)
param |
parameter vector: (beta_0, beta_1, ... , beta_m, sigma). |
xx |
design matrix of the model. |
y |
observation vector. |
tau |
threshold vector from tau_1 to tau_K. |
log-likelihood, vector with all observations.
Marvin Wright
Print lmmot object.
## S3 method for class 'lmmot' print(x, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'lmmot' print(x, digits = max(3, getOption("digits") - 3), ...)
x |
lmmot object to print. |
digits |
number of decimal digits to print. |
... |
further arguments passed to or from other methods. |
Marvin Wright
Print details about lmmot object.
## S3 method for class 'lmmot' summary(object, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'lmmot' summary(object, digits = max(3, getOption("digits") - 3), ...)
object |
lmmot object to print. |
digits |
number of decimal digits to print. |
... |
further arguments passed to or from other methods. |
Marvin Wright