Learn R Programming

hettx (version 0.1.3)

make.linear.data: Generate dataset according to a linear model.

Description

Given the parameters, generate a dataset and return a potential outcomes schedule (science table) of synthetic potential outcomes.

Usage

make.linear.data(
  n,
  gamma.vec = c(1, 2, 2, 1),
  gamma2.vec = NULL,
  beta.vec = c(-1, -1, 1),
  ideo.sd = 0,
  quad.tx = FALSE,
  mu.X = FALSE,
  corr.X = TRUE
)

make.quadradic.data(n, beta.vec = c(-1, -1, 1))

make.skew.data(n, beta.vec = c(-1, -1, 1))

Value

List of elements of data (not data frame)

Arguments

n

Sample size

gamma.vec

Control outcome surface

gamma2.vec

Quadratic terms

beta.vec

Treatment effect surface

ideo.sd

Ideosyncratic residual variation

quad.tx

Quadratic treatment effects?

mu.X

Center of the X covariates (can be single number or vector of length equal to the max of the length of gamma.vec, gamma2.vec, and beta.vec)

corr.X

TRUE or FALSE. Have Xs correlated or no.

Functions

  • make.quadradic.data: Generate dataset according to a quadratic model

  • make.skew.data: Generate dataset with a skew

Details

The control outcome surface is either linear or quadratic, of the form: $$Y_i = \\gamma_0 + \\sum_{k=1}^J \\gamma_k X_{ki} + \\sum_{k=1}^{J_2} \\gamma^{(2)}_k X_{ki}^2 + \\epsilon_i$$

The individual treatment effects are similarly a linear or quadratic model.