Learn R Programming

lava.tobit (version 0.4-6)

lava.tobit: Estimation and simulation of probit and tobit latent variable models

Description

Framwork for estimating parameters and simulate data from Latent Variable Models with binary and censored observations. Plugin for the lava package

Arguments

Details

ll{ Package: lava.tobit Type: Package Version: 0.4-5 Date: 2012-03-15 License: GPL-3 LazyLoad: yes }

Examples

Run this code
m <- lvm(list(c(y,z) ~ x, y~z))
## Simulate 200 observation from path analysis model
## with all slopes and residual variances set to 1 and intercepts 0:
d <- sim(m,200)
## Dichotomize y and introduce censoring on z
d <- transform(d, y=as.factor(y>0), z=Surv(z,z<2))
e <- estimate(m,d,control=list(trace=1))
effects(e,y~x)

Run the code above in your browser using DataLab