Toolkit for Weighting and Analysis of Nonequivalent Groups

A Tutorial on the TWANG Shiny Application for Three or More Treatment Groups

by Beth Ann Griffin, Chuck Stelzner, Ricardo Sanchez, Matthew Cefalu, Daniel F. McCaffrey

Download eBook for Free

FormatFile SizeNotes
PDF file 5 MB

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

This tutorial describes how to use a menu-driven Shiny application (app) based on the Toolkit for Weighting and Analysis of Nonequivalent Groups (TWANG) R package. The TWANG package was first developed in 2004 by RAND Corporation researchers for the R statistical computing language and environment. The Shiny software development package allowed the TWANG project team to develop a menu-driven app that can be used to perform analyses using the TWANG package's suite of commands without requiring a user to learn R. This tutorial provides an introduction about how to use the TWANG Shiny app to estimate propensity score weights and related treatment effects for comparing three or more treatment groups when using observational data. The tutorial demonstrates use of the Shiny app through an illustrative example and explains key inputs and outputs of the TWANG Shiny app.

Access the tool

Table of Contents

  • Chapter One


  • Chapter Two

    Setting Up

  • Chapter Three

    Estimating Propensity Scores

  • Chapter Four

    Evaluating the Quality of the PSWs

  • Chapter Five

    Analysis of Outcomes

  • Chapter Six

    Data Outputs

  • Chapter Seven

    Changes When Running an ATT Example

  • Chapter Eight


Research conducted by

This research was prepared for the National Institute on Drug Abuse and conducted by the Justice Policy Program within RAND Social and Economic Well-Being.

This report is part of the RAND Corporation 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

The RAND Corporation 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.