sampleSelection: Interfaces for sampleSelection package for data science...

Description Usage Arguments Details Value Author(s) Examples

Description

Interfaces to sampleSelection functions that can be used in a pipeline implemented by magrittr.

Usage

1
2
3
4

Arguments

data

data frame, tibble, list, ...

...

Other arguments passed to the corresponding interfaced function.

Details

Interfaces call their corresponding interfaced function.

Value

Object returned by interfaced function.

Author(s)

Roberto Bertolusso

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
## Not run: 
library(intubate)
library(magrittr)
library(sampleSelection)


## ntbt_probit: Binary choice models
## ntbt_binaryChoice:  (no examples found)
data(Mroz87)
Mroz87$kids <- Mroz87$kids5 > 0 | Mroz87$kids618 > 0
Mroz87$age30.39 <- Mroz87$age < 40
Mroz87$age50.60 <- Mroz87$age >= 50

## Original function to interface
probit(lfp ~ kids + age30.39 + age50.60 + educ + hushrs +
         huseduc + huswage + mtr + motheduc, data=Mroz87)

## The interface puts data as first parameter
ntbt_probit(Mroz87, lfp ~ kids + age30.39 + age50.60 + educ + hushrs +
              huseduc + huswage + mtr + motheduc)

## so it can be used easily in a pipeline.
Mroz87 %>%
  ntbt_probit(lfp ~ kids + age30.39 + age50.60 + educ + hushrs +
                huseduc + huswage + mtr + motheduc)



## ntbt_selection: Heckman-style selection models
## ntbt_heckit:
data( Mroz87 )
Mroz87$kids  <- ( Mroz87$kids5 + Mroz87$kids618 > 0 )

## Original function to interface
# Two-step estimation
heckit(lfp ~ age + I( age^2 ) + faminc + kids + educ,
        wage ~ exper + I( exper^2 ) + educ + city, Mroz87)
# ML estimation
selection(lfp ~ age + I( age^2 ) + faminc + kids + educ,
          wage ~ exper + I( exper^2 ) + educ + city, Mroz87)

## The interface puts data as first parameter
# Two-step estimation
ntbt_heckit(Mroz87, lfp ~ age + I( age^2 ) + faminc + kids + educ,
            wage ~ exper + I( exper^2 ) + educ + city)
# ML estimation
ntbt_selection(Mroz87, lfp ~ age + I( age^2 ) + faminc + kids + educ,
               wage ~ exper + I( exper^2 ) + educ + city)

## so it can be used easily in a pipeline.
# Two-step estimation
Mroz87 %>%
  ntbt_heckit(lfp ~ age + I( age^2 ) + faminc + kids + educ,
              wage ~ exper + I( exper^2 ) + educ + city)
# ML estimation
Mroz87 %>%
  ntbt_selection(lfp ~ age + I( age^2 ) + faminc + kids + educ,
                 wage ~ exper + I( exper^2 ) + educ + city)

## End(Not run)

intubate documentation built on May 2, 2019, 2:46 p.m.