coef.EMSS: Getting Coefficients of EM type Sample Selection Model Fits

Description Usage Arguments Value Examples

View source: R/EMSS.R

Description

coef method for a class "EMSS".

Usage

1
2
## S3 method for class 'EMSS'
coef(object, only = NULL, ...)

Arguments

object

an object of class "EMSS" made by the function EMSS.

only

a character value for choosing specific variable's coefficients. Initial value is NULL, which shows all variable's coefficients. If "response" is written, only coefficients for response variables will be returned, and if "selection" is written, only coefficients for selection variables will be returned.

...

not used, but exists because of the compatibility.

Value

a numeric vector or a list, containing one set or two sets, is given.

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
# examples continued from EMSS
data(Smoke, package = "EMSS")
ex1 <- EMSS(response = cigs_intervals ~ educ,
           selection = smoker ~ educ + age,
           data = Smoke)
coef(ex1)

data(Smoke, package = "EMSS")
ex2 <- EMSS(response = cigs_intervals ~ educ,
           selection =  smoker ~ educ + age,
           data = Smoke, method="ECMnr")
coef(ex2)

## example using random numbers with exclusion restriction

N <- 1000
errps <- mvtnorm::rmvnorm(N,c(0,0),matrix(c(1,0.5,0.5,1),2,2) )
xs <- runif(N)
ys <- xs+errps[,1]>0
xo <- runif(N)
yo <- (xo+errps[,2])*(ys>0)

ex3 <- EMSS(response = yo ~ xo,
           selection = ys ~ xs,
           initial.param = c(rep(0,4), 0.3, 0.6), method="ECMnr")
coef(ex3)

SangkyuStat/EMSS documentation built on Jan. 1, 2022, 7:19 p.m.