make_analyses: Estimation Function

Description Usage Arguments Value

View source: R/make_analyses.R

Description

Estimation Function

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
make_analyses(
  dv,
  treat,
  covs = NULL,
  heterogenous = NULL,
  FE = NULL,
  IPW = NULL,
  IV_list = NULL,
  cluster = NULL,
  robust = is.null(cluster),
  data,
  subset = NULL,
  estimator,
  estimator_name,
  treat_only = FALSE,
  status = NULL,
  round_digits = 3,
  return_df = FALSE,
  ...
)

Arguments

dv

Dependent variable specified as character.

treat

Treatment vector of variables specified as character vector.

covs

Character vector of covariates specified as character vector.

heterogenous

Character vector of covariates to interact with treatments specified as character vector.

FE

Character vector of fixed effects covariates specified as character vector.

IPW

Inverse probability weights specified as character vector.

IV_list

Character string. Should be a character string which presents valid IV formula as specified in lfe::felm.

cluster

Covariate for clustered robust standard errors as defined by multiwayvcov::cluster.vcov function. Currently only one clustering variable option supported specified as character vector.

robust

Logical. Whether to report heteroskedastic robust standard errors. Implemented only for linear models for now.

data

Data frame which contains all the relevant variables.

subset

character string specifing logical expression for subsetting.

estimator

Function that takes all arguments above, fit_formula and frame_df as arguments and returns a tibble with the following columns: "term" (required), "estimate" (required), "std.error" (optional), "p.value" (required).

estimator_name

Character string giving name of the estimator used

treat_only

TRUE/FALSE specifying whether only estimates directly related to treat should be reported (including heterogeneity variables). Defaults to FALSE.

status

Logical vector of length 3, specifying whether the model was pre-(R)egistered, run in (S)cript and reported in (P)aper respectively.

round_digits

Integer. How many decimal points to round to in the output.

return_df

If TRUE dataframe used for estimation will be returned.

...

Other parameters used in estimate function

Value

List of three objects. estimates is estimates from the model and corresponding standard errors. stat is vector of adjusted R squared and number of observations. model_spec is logical vector of characteristics of the model.


gerasy1987/usefulr documentation built on Aug. 31, 2021, 4:25 p.m.