Skip to contents

Build a validated dp object from raw user inputs

Usage

make_did_dp(
  data = NULL,
  y,
  d,
  post,
  covariates = NULL,
  dim_covariates = NULL,
  continuous = NULL,
  unordered = NULL,
  ordered = NULL,
  na_action = c("fail", "omit"),
  validate = TRUE
)

Arguments

data

Optional data frame or matrix containing the analysis variables.

y

Outcome vector, or a single column name/index when data is supplied.

d

Binary treatment indicator, or a single column name/index when data is supplied.

post

Binary post-period indicator, or a single column name/index when data is supplied.

covariates

Optional preassembled covariate matrix. If omitted, the covariates are built from data using the block selectors below.

dim_covariates

Optional length-3 dimension vector. This must be supplied when covariates is already assembled and the block selectors are not used.

continuous

Character or integer vector identifying continuous covariates in data or in covariates.

unordered

Character or integer vector identifying unordered discrete covariates in data or in covariates.

ordered

Character or integer vector identifying ordered discrete covariates in data or in covariates.

na_action

How to handle missing values in the variables used to build dp. "fail" stops, and "omit" drops incomplete rows.

validate

Logical; if TRUE, validate the output with validate_did_dp().

Value

A list in the internal dp format.