An implementation of the tidyr package in Stata
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
img
.gitignore
.sublime2Stata.do
README.md
gather.ado
gather.sthlp
license.txt
spread.ado
spread.sthlp
stata.toc
test.do
tidy.pkg
unite.ado
unite.sthlp

README.md

stata-tidy

This is a basic implementation of the tidyr package from R.

gather

gather transforms a wide dataset into a long dataset (i.e. reshape long). The command takes a list of variables as argument. This list corresponds to variables to gather.

Use the option label to save the variable labels as a new variable

spread

spread transforms a long dataset into a wide dataset (i.e. reshape wide). The command takes two variable names as argument. The first variable contains the new variable names. The second variable contains the new variable values.

Installation

net install tidy, from(https://github.com/matthieugomez/tidy.ado/raw/master/)

If you have a version of Stata < 13, you need to install it manually:

  1. Click the "Download ZIP" button in the right column to download a zipfile. Extract it into a folder (e.g. ~/SOMEFOLDER)
  2. Run: (changing SOMEFOLDER with whatever you picked)
    cap ado uninstall tidy
    net install tidy, from("~/SOMEFOLDER")