o_delta: Delta*

Description Usage Arguments Details Value References Examples

View source: R/robomit_functions.R

Description

Estimates delta*, i.e. the degree of selection on unobservables relative to observables that would be necessary to explain away the result, following Oster (2019).

Usage

1
o_delta(y, x, con, id = "none", time = "none", beta = 0, R2max, type, data)

Arguments

y

Name of the dependent variable (as string).

x

Name of the independent variable of interest (treatment variable; as string).

con

Name of the other control variables. Provided as string in the format: "w + z +...".

id

Name of the individual id variable (e.g. firm or farm; as string). Only applicable for fixed effect models.

time

Name of the time variable (e.g. year or month; as string). Only applicable for fixed effect models.

beta

Beta for which delta* should be estimated (default is beta = 0).

R2max

Max R-square for which beta* should be estimated.

type

Model type (either lm or plm; as string).

data

Data.

Details

Estimates delta*, i.e. the degree of selection on unobservables relative to observables that would be necessary to explain away the result, following Oster (2019). The function supports linear cross sectional (see lm objects in R) and panel fixed effect (see plm objects in R) models.

Value

Returns tibble object. Including delta* and various other information.

References

Oster, E. (2019). Unobservable selection and coefficient stability: Theory and evidence. Journal of Business & Economic Statistics, 37, 187-204.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# load data, e.g. the in-build mtcars dataset
data("mtcars")
data_oster <- mtcars

# preview of data
head(data_oster)

# load robomit
require(robomit)

# estimate delta*
o_delta(y = "mpg",               # define the dependent variable name
            x = "wt",            # define the main independent variable name
            con = "hp + qsec",   # other control variables
            beta = 0,            # define beta. This is usually set to 0
            R2max = 0.9,         # define the max R-square.
            type = "lm",         # define model type
            data = data_oster)   # define dataset

robomit documentation built on Sept. 15, 2020, 5:07 p.m.

Related to o_delta in robomit...