*! version 1.0 10jul2017

Title

gather -- An easier way to reshape long

Syntax

gather varlist , [variable(newvar) value(newvar) label(newvar)]

Description

gather takes a list of variables varlist and collapses into variable-value pairs. It is a simpler version of reshape long. Its goal is similar to the homonym function in the R package tidyr.

Options

variable(newvar) name of new variable corresponding to variable names. Defaults to "variable"

value(newvar) name of new variable corresponding to variable values. Defaults to "values"

label(newvar) creates a new variable to store the variable labels of varlist

Examples

. sysuse educ99gdp.dta, clear

. gather public private

Author

Matthieu Gomez

Department of Economics, Princeton University

Please report issues on Github
https://github.com/matthieugomez/stata-tidy