Skip to content

sampleSelection

Sample Selection Models

v1.2-14 · Jan 20, 2026 · GPL (>= 2)

Description

Two-step and maximum likelihood estimation of Heckman-type sample selection models: standard sample selection models (Tobit-2), endogenous switching regression models (Tobit-5), sample selection models with binary dependent outcome variable, interval regression with sample selection (only ML estimation), and endogenous treatment effects models. These methods are described in the three vignettes that are included in this package and in econometric textbooks such as Greene (2011, Econometric Analysis, 7th edition, Pearson).

Downloads

CRAN

6.5K

Last 30 days

1475th

23.5K

Last 90 days

99.5K

Last year

Trend: -29.9% (30d vs prior 30d)

r2u CRAN

33

Last 30 days

529

Last 90 days

4K

Last year

Trend: -78.2% (30d vs prior 30d)

CRAN Check Status

1 NOTE
12 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 NOTE
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (1 non-OK)
NOTE r-oldrel-macos-arm64

tests

Running ‘Mroz87SelectionTest.R’ [1s/1s]
  Comparing ‘Mroz87SelectionTest.Rout’ to ‘Mroz87SelectionTest.Rout.save’ ...76c76
< imrData$IMR1  -1.097620   1.252900   -0.88     0.38    
---
> imrData$IMR1  -1.097619   1.252900   -0.88     0.38    
88c88
< Return code 2: successive function values within tolerance limit (tol)
---
> Return code 1: gradient close to zero (gradtol)
120c120
<     -1.097620  
---
>     -1.097619  
144c144
< invMillsRatio -1.097620    1.26599  -0.867 3.86e-01
---
> invMillsRatio -1.097619    1.26599  -0.867 3.86e-01
171c171
< educ              -0.1904  0.000725  -2.53e-05  1.01e-02 -2.82e-03
---
> educ              -0.1904  0.000725  -2.53e-05  1.00e-02 -2.82e-03
196c196
< educ              -0.1904  0.000725  -2.53e-05  1.01e-02 -2.82e-03
---
> educ              -0.1904  0.000725  -2.53e-05  1.00e-02 -2.82e-03
  Running ‘binarySelectionOutcome.R’ [2s/2s]
  Comparing ‘binarySelectionOutcome.Rout’ to ‘binarySelectionOutcome.Rout.save’ ... OK
  Running ‘fail.R’ [1s/1s]
  Comparing ‘fail.Rout’ to ‘fail.Rout.save’ ... OK
  Running ‘heckitIvTest.R’ [1s/1s]
  Comparing ‘heckitIvTest.Rout’ to ‘heckitIvTest.Rout.save’ ... OK
  Running ‘intervalTest.R’ [3s/3s]
  Comparing ‘intervalTest.Rout’ to ‘intervalTest.Rout.save’ ... OK
  Running ‘invMillsRatioTest.R’ [3s/3s]
  Comparing ‘invMillsRatioTest.Rout’ to ‘invMillsRatioTest.Rout.save’ ... OK
  Running ‘probit.R’ [1s/1s]
  Comparing ‘probit.Rout’ to ‘probit.Rout.save’ ...4426c4426
< Return code 2: successive function values within tolerance limit (tol)
---
> Return code 1: gradient close to zero (gradtol)
6183c6183
<  7.04e-02  1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.95e-06  7.73e-01  7.52e-01 
---
>  7.04e-02  1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.96e-06  7.73e-01  7.52e-01 
  Running ‘selection.R’ [3s/3s]
  Comparing ‘selection.Rout’ to ‘selection.Rout.save’ ... OK

Check History

NOTE 12 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 27, 2026
NOTE r-oldrel-macos-arm64

tests

Running ‘Mroz87SelectionTest.R’ [1s/1s]
  Comparing ‘Mroz87SelectionTest.Rout’ to ‘Mroz87SelectionTest.Rout.save’ ...76c76
< imrData$IMR1  -1.097620   1.252900   -0.88     0.38    
---
> imrData$IMR1  -1.097619   1.252900   -0.88     0.38    
88c88
<
...[truncated]...
 1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.95e-06  7.73e-01  7.52e-01 
---
>  7.04e-02  1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.96e-06  7.73e-01  7.52e-01 
  Running ‘selection.R’ [3s/3s]
  Comparing ‘selection.Rout’ to ‘selection.Rout.save’ ... OK
WARNING 11 OK · 1 NOTE · 1 WARNING · 0 ERROR · 0 FAILURE Jun 14, 2026
WARNING r-release-linux-x86_64

re-building of vignette outputs

Error(s) in re-building vignettes:
  ...
--- re-building ‘intReg.Rnw’ using Sweave
Loading required package: miscTools

Please cite the 'maxLik' package as:
Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation 
...[truncated]...
orum or 'tracker' at maxLik's R-Forge site:
https://r-forge.r-project.org/projects/maxlik/
--- finished re-building ‘treatReg.Rnw’

SUMMARY: processing the following file failed:
  ‘selection.Rnw’

Error: Vignette re-building failed.
Execution halted
NOTE r-oldrel-macos-arm64

tests

Running ‘Mroz87SelectionTest.R’ [1s/1s]
  Comparing ‘Mroz87SelectionTest.Rout’ to ‘Mroz87SelectionTest.Rout.save’ ...76c76
< imrData$IMR1  -1.097620   1.252900   -0.88     0.38    
---
> imrData$IMR1  -1.097619   1.252900   -0.88     0.38    
88c88
<
...[truncated]...
 1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.95e-06  7.73e-01  7.52e-01 
---
>  7.04e-02  1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.96e-06  7.73e-01  7.52e-01 
  Running ‘selection.R’ [3s/3s]
  Comparing ‘selection.Rout’ to ‘selection.Rout.save’ ... OK
NOTE 12 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
NOTE r-oldrel-macos-arm64

tests

Running ‘Mroz87SelectionTest.R’ [1s/1s]
  Comparing ‘Mroz87SelectionTest.Rout’ to ‘Mroz87SelectionTest.Rout.save’ ...76c76
< imrData$IMR1  -1.097620   1.252900   -0.88     0.38    
---
> imrData$IMR1  -1.097619   1.252900   -0.88     0.38    
88c88
<
...[truncated]...
 1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.95e-06  7.73e-01  7.52e-01 
---
>  7.04e-02  1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.96e-06  7.73e-01  7.52e-01 
  Running ‘selection.R’ [3s/3s]
  Comparing ‘selection.Rout’ to ‘selection.Rout.save’ ... OK
ERROR 11 OK · 1 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 7, 2026
ERROR r-devel-linux-x86_64-debian-gcc

PDF version of manual

Rd conversion errors:
Converting parsed Rd's to LaTeX ..Warning in file(out, "wt") :
  cannot open file '/tmp/RtmpUaDuiX/filed3cc43823c47a': No space left on device
Warning in file(con, "r") :
  cannot open file '/tmp/RtmpUaDuiX/filed3cc43823c47a': No such file or directory
Error in file(con, "r") : cannot open the connection
NOTE r-oldrel-macos-arm64

tests

Running ‘Mroz87SelectionTest.R’ [1s/1s]
  Comparing ‘Mroz87SelectionTest.Rout’ to ‘Mroz87SelectionTest.Rout.save’ ...76c76
< imrData$IMR1  -1.097620   1.252900   -0.88     0.38    
---
> imrData$IMR1  -1.097619   1.252900   -0.88     0.38    
88c88
<
...[truncated]...
 1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.95e-06  7.73e-01  7.52e-01 
---
>  7.04e-02  1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.96e-06  7.73e-01  7.52e-01 
  Running ‘selection.R’ [3s/3s]
  Comparing ‘selection.Rout’ to ‘selection.Rout.save’ ... OK
NOTE 12 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
NOTE r-devel-macos-arm64

tests

Running ‘Mroz87SelectionTest.R’ [1s/1s]
  Comparing ‘Mroz87SelectionTest.Rout’ to ‘Mroz87SelectionTest.Rout.save’ ...76c76
< imrData$IMR1  -1.097620   1.252900   -0.88     0.38    
---
> imrData$IMR1  -1.097619   1.252900   -0.88     0.38    
88c88
<
...[truncated]...
 1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.95e-06  7.73e-01  7.52e-01 
---
>  7.04e-02  1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.96e-06  7.73e-01  7.52e-01 
  Running ‘selection.R’ [3s/3s]
  Comparing ‘selection.Rout’ to ‘selection.Rout.save’ ... OK
NOTE r-release-macos-arm64

tests

Running ‘Mroz87SelectionTest.R’ [1s/1s]
  Comparing ‘Mroz87SelectionTest.Rout’ to ‘Mroz87SelectionTest.Rout.save’ ...76c76
< imrData$IMR1  -1.097620   1.252900   -0.88     0.38    
---
> imrData$IMR1  -1.097619   1.252900   -0.88     0.38    
88c88
<
...[truncated]...
 1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.95e-06  7.73e-01  7.52e-01 
---
>  7.04e-02  1.46e-01  1.72e-01  2.22e-01 -4.72e-01  8.96e-06  7.73e-01  7.52e-01 
  Running ‘selection.R’ [3s/3s]
  Comparing ‘selection.Rout’ to ‘selection.Rout.save’ ... OK

Reverse Dependencies (15)

Dependency Network

Dependencies Reverse dependencies maxLik miscTools systemfit Formula (>= 1.1-1) VGAM mvtnorm EMSS HeckmanEM localIV ssmrob xtsum AER OPSR fastqrs hpa insight marginaleffects micsr parameters ssmodels urbin sampleSelection

Version History

21 tracked
new 1.2-14 Mar 10, 2026
updated 1.2-14 ← 1.2-12 diff Jan 19, 2026
updated 1.2-12 ← 1.2-10 diff Dec 14, 2020
updated 1.2-10 ← 1.2-6 diff Nov 3, 2020
updated 1.2-6 ← 1.2-2 diff May 2, 2019
updated 1.2-2 ← 1.2-0 diff Feb 18, 2019
updated 1.2-0 ← 1.0-4 diff Dec 6, 2017
updated 1.0-4 ← 1.0-2 diff Nov 2, 2015
updated 1.0-2 ← 0.7-2 diff Jun 23, 2014
updated 0.7-2 ← 0.7-0 diff Aug 13, 2012
updated 0.7-0 ← 0.6-12 diff Mar 4, 2012
updated 0.6-12 ← 0.6-10 diff Nov 12, 2011
updated 0.6-10 ← 0.6-8 diff Aug 11, 2010
updated 0.6-8 ← 0.6-6 diff Oct 15, 2009
updated 0.6-6 ← 0.6-4 diff Jul 17, 2009