o_beta: Beta*

Description Usage Arguments Details Value References Examples

View source: R/robomit_functions.R

Description

Estimates beta*, i.e. the estimated bias-adjusted treatment effects, following Oster (2019).

Usage

1
o_beta(y, x, con, id = "none", time = "none", delta = 1, 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.

delta

Delta for which beta* should be estimated (default is delta = 1).

R2max

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

type

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

data

Data.

Details

Estimates beta*, i.e. the estimated bias-adjusted treatment effects, 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 beta* 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 beta*
o_beta(y = "mpg",               # define the dependent variable name
           x = "wt",            # define the main independent variable name
           con = "hp + qsec",   # other control variables
           delta = 1,           # define delta. This is usually set to 1
           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_beta in robomit...