generate_rd_data: Generate simulated data for RD design

Description Usage Arguments Value

View source: R/generate_data.R

Description

Data set contains measured covariates X, outcome Y, treatment assignment t, and logit(propensity), mu.

covariate data ~ normal(0,1); t = 0 if X1 < c, 1 otherwise; y ~ rho * X1 + sqrt(1-rho^2) * X2 + tau * t + epsilon; epsilon ~ normal(0, 1)

Usage

1
2
3
4
5
6
7
8
generate_rd_data(
  N = 1000,
  p = 10,
  c = qnorm(0.75),
  rho = 0,
  sigma = 1,
  tau = 1
)

Arguments

N

numeric, sample size

p

numeric, number of features

c

numeric, cutoff for forcing variable

rho

numeric between 0 and 1. 0 => prog orthogonal to prop, 1=> prog || prop

sigma

numeric noise to be added to y. y += sigma*rnorm(0,1)

tau

numeric additive treatment effect

Value

data.frame of covariates, y, t, and mu


raikens1/RACplots documentation built on July 10, 2021, 11:08 a.m.