Skip to content

mhamjediers/sankeyplot

Repository files navigation

StataMin issues license Stars version

sankeyplot, version 1.21

Stata module to create Sankey digramms

To download and install the module from the Statistical Software Components (SSC):

ssc install sankeyplot

Alternatively install current version from GitHub (GitHub files might contain latest updates that have not been currently pushed to SSC):

net install sankeyplot, from("https://raw.githubusercontent.com/mhamjediers/sankeyplot/master/")

Suggested citation:

Hamjediers, M. (2022): SANKEYPLOT: Stata module to produce Sankey diagramms. Statistical Software Components S459089, Boston College Department of Economics.

Description

'sankeyplot' creates a sankey diagram, which visualizes flow of the values of one variable to another.

In the default setting, the command assumes that the data is given in a wide format (each variable presents a domain). The command takes two or more categorical variables as input, which should represent the same set of values aross domains (e.g., waves or generations).

If the data that should be plotted is in a long format (obsverations represent domains), specify the long-option and three variables as the input: the categorical variable that should be plotted, an identifier of the observations (e.g., pid), and a domain variable (e.g., wave).

Altough it is most common to visualize flows among variables with the same set of values, specifying two different set of values is also possible. Yet, note that the legend and colors will be based on the variable mentioned in varlist. If two different variables are used it is recommended to use the options blabel(catlabel) and legend(off).

Exemplary graphs

About

Stata ado-file to create Sankey plots (alluvial plot, stream graph, graph of out-flows)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published