Cover: Toolkit for Weighting and Analysis of Nonequivalent Groups

Toolkit for Weighting and Analysis of Nonequivalent Groups

A Tutorial on the TWANG Commands for Stata

Published Sep 18, 2015

by Matthew Cefalu, Shuangshuang Liu, Craig Martin

View Online

Download Free Electronic Document

FormatFile SizeNotes
PDF file 1.3 MB

Use Adobe Acrobat Reader version 10 or higher for the best experience.

Download Support Files


Version 1.3.0 (posted 04-10-2017)

FormatFile SizeNotes
zip file 0.1 MB

The file(s) provided above are ZIP-formatted archives, which most modern systems can natively unpack. If your computer does not unpack the archive when you double-click it, you may need to use a separate decompression program such as UnZip.

The Toolkit for Weighting and Analysis of Nonequivalent Groups, TWANG, contains a set of commands to support causal modeling of observational data through the estimation and evaluation of propensity scores and associated weights. The TWANG package was first developed in 2004 by RAND researchers for the R statistical computing language and environment. The R version of the package contains functions for creating high-quality propensity score weights that can be used to estimate treatment effects with two or more treatment groups. The Stata TWANG commands were developed in 2015 to support the use of the TWANG tools without requiring researchers and analysts to learn R. This tutorial provides an introduction to TWANG and demonstrates its use through illustrative examples. This tool includes the TWANG commands for Stata, a tutorial on their use, and the sample code and datasets used in the tutorial.

This report is part of the RAND tool series. RAND tools may include models, databases, calculators, computer code, GIS mapping tools, practitioner guidelines, web applications, and various toolkits. All RAND tools undergo rigorous peer review to ensure both high data standards and appropriate methodology in keeping with RAND's commitment to quality and objectivity.

This document and trademark(s) contained herein are protected by law. This representation of RAND intellectual property is provided for noncommercial use only. Unauthorized posting of this publication online is prohibited; linking directly to this product page is encouraged. Permission is required from RAND to reproduce, or reuse in another form, any of its research documents for commercial purposes. For information on reprint and reuse permissions, please visit

RAND is a nonprofit institution that helps improve policy and decisionmaking through research and analysis. RAND's publications do not necessarily reflect the opinions of its research clients and sponsors.