Unstack data from single variable into multiple variables

converts
the tall table, `W`

= unstack(`T`

,`vars`

,`ivar`

)`T`

, to an equivalent table, `W`

,
that is in wide format. `unstack`

unstacks a single
variable in `T`

, specified by `vars`

,
into multiple variables in `W`

. In general, `W`

contains
more variables, but fewer rows, than `T`

.

An indicator variable in `T`

, specified by `ivar`

,
determines which variable in `W`

contains each value
in `var`

after it is unstacked. `unstack`

treats
the remaining variables in `T`

as grouping variables.
Each unique combination of values in the grouping variables identifies
a group of rows in `T`

that will be unstacked into
a single row of `W`

.

converts
the table `W`

= unstack(`T`

,`vars`

,`ivar`

,`Name,Value`

)`T`

to wide format with additional options
specified by one or more `Name,Value`

pair arguments.

For example, you can specify how `unstack`

converts
variables from `T`

to variables in `W`

.

Was this topic helpful?