library(AER) ?Affairs data("Affairs") fm_ols <- lm(affairs ~ age + yearsmarried + religiousness + occupation + rating, data = Affairs) summary(fm_ols) fm_tobit <- tobit(affairs ~ age + yearsmarried + religiousness + occupation + rating, data = Affairs) summary(fm_tobit) cbind(coefficients(fm_ols), coefficients(fm_tobit)) fm_tobit2 <- tobit(affairs ~ age + yearsmarried + religiousness + occupation + rating, right = 4, data = Affairs) summary(fm_tobit2) cbind(coefficients(fm_ols), coefficients(fm_tobit), coefficients(fm_tobit2)) fm_tobit3 <- tobit(affairs ~ gender + age + yearsmarried + religiousness + education + occupation + rating, data = Affairs) summary(fm_tobit3) library(sampleSelection) Affairs$any <- ifelse(Affairs$affairs>0, 1, 0) fm_heckit <- heckit(selection = any ~ yearsmarried + religiousness + occupation + rating, outcome = affairs ~ age + gender + occupation, data=Affairs, method = "ml") summary(fm_heckit) ?Mroz87 data( Mroz87 ) labor.ols <- lm(wage ~ exper + I( exper^2 ) + educ + city, data=Mroz87) summary(labor.ols) labor.heckit <- selection( lfp ~ faminc + kids5 + educ, wage ~ exper + I( exper^2 ) + educ + city, data=Mroz87, method = "ml" ) summary(labor.heckit) AIC(labor.heckit)