I got an email, asking me if our arm package can simulate tobit model to get simulated parameters. Indeed, arm does not suport tobit model. It only support sim() for lm, glm and mer classes in R. But it is not difficult to get a tobit verison of sim(). Here are the steps:
1. fit a tobit (or double tobit) mode.
library(AER)
M1 <- tobit(y ~x)
2. get the coefficient vector.
beta <- coef(M1)
3. extract variance covariance matrix from the tobit model.
V.beta <- vcov(M1)
4. create a matrix of coefs with uncertainty from multivariate normal.
n.sim <- 100
coef.sim <- mvrnorm(n.sim, beta, V.beta)
coef.sim is the object of simlutated parameters of the tobit model with uncertainty.
17 hours ago
1 comment:
Zelig does the same thing. See here.
Post a Comment