Learn R Programming

robomit (version 1.0.3)

o_beta: Beta*

Description

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

Usage

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.

Value

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

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.

References

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

Examples

Run this code
# NOT RUN {
# 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
# }

Run the code above in your browser using DataLab