
tobit(Lower = 0, Upper = Inf, lmu="identity", lsd="loge",
imethod=1, zero=2)
Links
for more choices.
The standard deviation is a positive quantity, therefore a log link
is its default.zero=NULL
means both linear/additive predictors
are modelled as functions of the explanatory v"vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
. The defaults for Lower
and Upper
correspond to the
classical Tobit model. By default, the mean $x_i^T \beta$ is the first linear/additive predictor, and the log of the
standard deviation is the second linear/additive predictor. The Fisher
information matrix for uncensored data is diagonal.
The fitted values are the estimates of $x_i^T \beta$.
normal1
,
cnormal1
.
dcnormal1
.n = 1000
x = seq(-1, 1, len=n)
f = function(x) 1 + 4*x
ystar = f(x) + rnorm(n)
Lower = 1
Upper = 4
y = pmax(ystar, Lower)
y = pmin(y, Upper)
plot(x, y, main="Tobit model", las=1)
legend(-0.9, 3, c("Truth", "Estimate"), col=c("Blue", "Red"), lwd=2)
table(y==Lower | y==Upper) # How many censored values?
fit = vglm(y ~ x, tobit(Lower=Lower, Upper=Upper), trace=TRUE)
table(fit@extra$censoredL)
table(fit@extra$censoredU)
coef(fit, matrix=TRUE)
lines(x, f(x), col="blue", lwd=2) # The truth
lines(x, fitted(fit), col="red", lwd=2, lty="dashed") # The estimate
summary(fit)
Run the code above in your browser using DataLab