smd_stat: Standardized mean differences

Description Usage Arguments Value Examples

View source: R/smd_stat.R

Description

Compute the standardized mean differences for each individual covariate in x, i.e., the mean difference of each column of x is standarzied by the pooled standard deviation calculated based on the original data before matching (xf and zf).

Usage

1
smd_stat(x,z,xf,zf)

Arguments

x

A matrix with length(z) rows giving the covariates after matching.

z

A vector whose ith coordinate is 1 for a matched treated unit and is 0 for a matched control.

xf

A matrix with length(zf) rows giving the covariates before matching.

zf

A vector whose ith coordinate is 1 for a treated unit and is 0 for a control.

Value

A vector of standardized mean differences for each column of x.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(optmatch)
data("SSRI")
attach(SSRI)
X<-cbind(female,black,education)
dist<-DiPs::maha_dense(z,X)
o<-DiPs::match(z, dist, SSRI)
M0<-o$data
Xm<-cbind(M0$female,M0$black,M0$education)
smd_stat(Xm,M0$z,X,z)
detach(SSRI)

met documentation built on Aug. 14, 2020, 5:07 p.m.

Related to smd_stat in met...