Learn R Programming

ivmte (version 1.0.1)

design: Generating design matrices

Description

This function generates the design matrix given an IV specification.

Usage

design(formula, data, subset)

Arguments

formula

Formula with which to generate the design matrix.

data

data.frame with which to generate the design matrix.

subset

Condition to select subset of data.

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

Run this code
# NOT RUN {
design(formula = ey ~ d | z,
           data = dtm,
           subset = z %in% c(1, 2))

# }

Run the code above in your browser using DataLab