design {ivmte} | R Documentation |
Generating design matrices
Description
This function generates the design matrix given an IV specification.
Usage
design(formula, data, subset, treat, orig.names)
Arguments
formula |
Formula with which to generate the design matrix. |
data |
|
subset |
Condition to select subset of data. |
treat |
The name of the treatment variable. This should only be passed when constructing OLS weights. |
orig.names |
character vector of the terms in the final design
matrix. This is required when the user declares an IV-like
formula where the treatment variable is passed into the
|
Value
Three matrices are returned: one for the outcome variable, Y; one for the second stage covariates, X; and one for the first stage covariates, Z.
Examples
dtm <- ivmte:::gendistMosquito()
design(formula = ey ~ d | z,
data = dtm,
subset = z %in% c(1, 2))