manual_stratify: Manual Stratify

Description Usage Arguments Value See Also Examples

View source: R/manual_stratify.R

Description

Stratifies a data set based on a set of blocking covariates specified by the user. Creates a manual_strata object, which can be passed to strata_match for stratified matching or unpacked by the user to be matched by some other means.

Usage

1
manual_stratify(data, strata_formula, force = FALSE)

Arguments

data

data.frame with observations as rows, features as columns

strata_formula

the formula to be used for stratification. (e.g. treat ~ X1) the variable on the left is taken to be the name of the treatment assignment column, and the variables on the left are taken to be the variables by which the data should be stratified

force

a boolean. If true, run even if a variable appears continuous. (default = FALSE)

Value

Returns a manual_strata object. This contains:

See Also

auto_stratify, new_manual_strata

Examples

1
2
3
4
5
6
7
8
  # make sample data set
  dat <- make_sample_data(n = 75)
  
  # stratify based on B1 and B2
  m.strat <- manual_stratify(dat, treat ~ B1 + B2)
  
  # diagnostic plot
  plot(m.strat)

raikens1/stratamatch documentation built on Aug. 6, 2020, 7:29 a.m.