getStandardizedCovMeanDiffs: Get Standardized Covariate Mean Differences

Description Usage Arguments Value Author(s) References Examples

View source: R/getStandardizedCovMeanDiffs.R

Description

getStandardizedCovMeanDiffs returns the standardized covariate mean differences between two groups.

Usage

1

Arguments

X

Covariate matrix (with units as rows and covariates as columns).

indicator

Binary indicator vector (must contain 1 or 0 for each unit). For example, could be a binary treatment or instrument.

Value

Standardized covariate mean differences between two groups.

Author(s)

Zach Branson and Luke Keele

References

Branson, Z. and Keele, L. (2020). Evaluating a Key Instrumental Variable Assumption Using Randomization Tests. American Journal of Epidemiology. To appear.

Examples

1
2
3
4
5
6
7
8
	#load the data
	data(icu.data)
	#the covariate matrix is
	X = as.matrix(subset(icu.data, select = -c(open_bin, icu_bed)))
	#standardized covariate mean differences across the treatment
	getStandardizedCovMeanDiffs(X = X, indicator = icu.data$icu_bed)
	#standardized covariate mean differences across the instrument
	getStandardizedCovMeanDiffs(X = X, indicator = icu.data$open_bin)

ivmodel documentation built on Jan. 16, 2021, 5:28 p.m.