R Under development (unstable) (2026-01-18 r89306 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library( "sampleSelection" ) Loading required package: maxLik Loading required package: miscTools Please cite the 'maxLik' package as: Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1. If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site: https://r-forge.r-project.org/projects/maxlik/ > > try( selection( s ~ z1, y ~ x1, type = "w" ) ) Error in checkModelType(type, selection, outcome) : 'type' in 'selection()' must be either '2', '5', or 'teatment' Currently w > > > # tobit 2 > > try( selection( s ~ z1, y ~ x1 ) ) Error in eval(predvars, data, env) : object 's' not found > > try( selection( s ~ z1, y ~ x1, type = "2" ) ) Error in eval(predvars, data, env) : object 's' not found > > try( selection( "s ~ z1", y ~ x1 ) ) Error in checkModelType(type, selection, outcome) : argument 'selection' must be a formula in function 'selection()' > > try( selection( "s ~ z1", y ~ x1, type = "2" ) ) Error in checkModelType(type, selection, outcome) : argument 'selection' must be a formula in function 'selection()' > > try( selection( ~ z1, y ~ x1 ) ) Error in checkModelType(type, selection, outcome) : argument 'selection' must be a 2-sided formula in function 'selection()' > > try( selection( ~ z1, y ~ x1, type = "2" ) ) Error in checkModelType(type, selection, outcome) : argument 'selection' must be a 2-sided formula in function 'selection()' > > try( selection( s ~ z1, "y ~ x1" ) ) Error in detectModelType(selection, outcome) : argument 'outcome' must be a formula or a list of formulas > > try( selection( s ~ z1, "y ~ x1", type = "2" ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome' must be either a formula or a list of two formulas in function 'selection()' > > try( selection( s ~ z1, ~ x1 ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome' must be a 2-sided formula in function 'selection()' > > try( selection( s ~ z1, ~ x1, type = "2" ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome' must be a 2-sided formula in function 'selection()' > > try( selection( s ~ z1, list( y ~ x1, y ~ x1 ), type = "2" ) ) Error in checkModelType(type, selection, outcome) : type-2 and treatment models require a single outcome in function 'selection()'. Currently a list of length 2 > > > # tobit 5 > > try( selection( s ~ z1, list( y1 ~ x1, y2 ~ x1 ) ) ) Error in eval(predvars, data, env) : object 's' not found > > try( selection( s ~ z1, list( y1 ~ x1, y2 ~ x1 ), type = "5" ) ) Error in eval(predvars, data, env) : object 's' not found > > try( selection( "s ~ z1", list( y1 ~ x1, y2 ~ x1 ) ) ) Error in checkModelType(type, selection, outcome) : argument 'selection' must be a formula in function 'selection()' > > try( selection( ~ z1, list( y1 ~ x1, y2 ~ x1 ) ) ) Error in checkModelType(type, selection, outcome) : argument 'selection' must be a 2-sided formula in function 'selection()' > > try( selection( s ~ z1, list( "y1 ~ x1", y2 ~ x1 ) ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome[[1]]' must be a formula in function 'selection()' > > try( selection( s ~ z1, list( ~ x1, y2 ~ x1 ) ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome[[1]]' must be a 2-sided formula in in 'selection(~x1y2 ~ x1~sz1)' > > try( selection( s ~ z1, list( y1 ~ x1, "y2 ~ x1" ) ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome[[2]]' must be a formula in function 'selection()' > > try( selection( s ~ z1, list( y1 ~ x1, ~ x1 ) ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome[[2]]' must be a 2-sided formula in function 'selection()' > > try( selection( s ~ z1, y1 ~ x1, type = "5" ) ) Error in checkModelType(type, selection, outcome) : type '5' selection models need dual outcomes as a list of two formulas > > try( selection( s ~ z1, "y1 ~ x1", type = "5" ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome' must be either a formula or a list of two formulas in function 'selection()' > > > # treatment effects models > > try( selection( s ~ z1, y1 ~ s + x1, type = "treatment" ) ) Error in eval(predvars, data, env) : object 's' not found > > try( selection( s ~ z1, y1 ~ x1, type = "treatment" ) ) Error in eval(predvars, data, env) : object 's' not found > > try( selection( "s ~ z1", y1 ~ s + x1, type = "treatment" ) ) Error in checkModelType(type, selection, outcome) : argument 'selection' must be a formula in function 'selection()' > > try( selection( ~ z1, y1 ~ s + x1, type = "treatment" ) ) Error in checkModelType(type, selection, outcome) : argument 'selection' must be a 2-sided formula in function 'selection()' > > try( selection( s ~ z1, "y1 ~ s + x1", type = "treatment" ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome' must be either a formula or a list of two formulas in function 'selection()' > > try( selection( s ~ z1, ~ s + x1, type = "treatment" ) ) Error in checkModelType(type, selection, outcome) : argument 'outcome' must be a 2-sided formula in function 'selection()' > > try( selection( s ~ z1, list( y1 ~ s + x1, y1 ~ s + x1 ), type = "treatment" ) ) Error in checkModelType(type, selection, outcome) : type-2 and treatment models require a single outcome in function 'selection()'. Currently a list of length 2 > > > proc.time() user system elapsed 1.00 0.20 1.18