getCovMeanDiffs: Covariate Mean Differences

Description Usage Arguments Value Author(s) See Also Examples

View source: R/getCovMeanDiffs.R

Description

getCovMeanDiffs computes the covariate mean differences between a treatment and control group.

Usage

1
getCovMeanDiffs(X, indicator)

Arguments

X

A covariate matrix (rows correspond to subjects/units; columns correspond to covariates).

indicator

A vector of 1s and 0s (e.g., denoting treatment and control).

Value

The covariate mean differences between a treatment and control group, defined as treatment minus control.

Author(s)

Zach Branson

See Also

See also lalondeMatches for details about the Lalonde and matched datasets.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
	#This loads the classic Lalonde (1986) dataset,
	#as well as two matched datasets:
	#one from 1:1 propensity score matching,
	#and one from cardinality matching, where
	#the standardized covariate mean differences are all below 0.1.
	data("lalondeMatches")

	#obtain the covariates for these datasets
	X.lalonde = subset(lalonde, select = -c(treat))
	X.matched.ps = subset(lalonde.matched.ps, select = -c(treat,subclass))
	X.matched.card = subset(lalonde.matched.card, select = -c(treat,subclass))
	#the treatment indicators are
	indicator.lalonde = lalonde$treat
	indicator.matched.ps = lalonde.matched.ps$treat
	indicator.matched.card = lalonde.matched.card$treat
	
	#the covariate mean differences are:
	getCovMeanDiffs(X = X.lalonde, indicator = indicator.lalonde)
	getCovMeanDiffs(X = X.matched.ps, indicator = indicator.matched.ps)
	getCovMeanDiffs(X = X.matched.card, indicator = indicator.matched.card)

randChecks documentation built on March 19, 2021, 1:06 a.m.