generate_blocked_data_linear: Make data from a linear model specification

View source: R/gen_blocked_data.R

generate_blocked_data_linearR Documentation

Make data from a linear model specification

Description

Function that, given a covariate vector X, returns a dataframe of potential outcomes and blocks.

Generate data, form_blocks_from_continuous, and randomize within block and generate observed potential outcomes

Usage

generate_blocked_data_linear(
  X = c(0, 2, 3, 19, 20, 21, 24, 31, 32, 40, 41, 43, 45, 55, 60, 65),
  a = 0,
  b = 0,
  ATE = 0.2,
  d = 0
)

generate_blocked_data_obs_linear(
  X = c(0, 2, 3, 19, 20, 21, 24, 31, 32, 40, 41, 43, 45, 55, 60, 65),
  p = 0.5,
  a = 0,
  b = 0,
  ATE = 0.2,
  d = 0,
  method = c("small", "pair", "big", "none")
)

Arguments

X

vector of indiviual level covariates

a

Intercept of Y0

b

Main effect of X

ATE

Average Tx

d

Interaction effect term.

p

Proportion of units treated (as close as possible given block sizes)

method

How to block

Details

This uses the model: Y = a + bX + ATE Z + d X ATE + epsilon (It will standardize X for this model, and then standardize Y0, Y1 so sd(Y0) = 1.)

Value

Dataframe with original potential outcomes and observed outcome based on random assigment.


lmiratrix/blkvar documentation built on Nov. 18, 2024, 1:27 p.m.