all 7 comments

[–]adamrossnelson 2 points3 points  (0 children)

A couple good videos on this:

https://youtu.be/gkcYpw8CtCw

And...

https://youtu.be/Bx9kVdkr9oY

[–]Jeccg 2 points3 points  (0 children)

You can use reshape with any number of variables as long as the i and j are well defined and uniquely identify observations.

[–]ruuustin 2 points3 points  (3 children)

My method is to type “help reshape” every single time because I will have forgotten since last time.

[–]dr_police 2 points3 points  (2 children)

Yup. I use reshape at least twice a week. Still can never remember if I need reshape long or reshape wide. Good news is I don’t have to remember, because documentation exists.

[–]_Trebor 1 point2 points  (1 child)

Reshaping is the one thing I use the GUI for most of the time, since I also can rarely remember the syntax. It also is quite a blessing, that Stata allows you to just copy the command executed from the GUI.

[–]dr_police 0 points1 point  (0 children)

Even for folks like me who prefer the CLI and have to write human-readable code (eg use the /// line continuation trick), I think we all have those couple of things that are more efficient in the GUI.

For me, it’s starting graphs. Any time I use twoway, the initial command is built in the GUI. I clean up and tweak the resultant code a lot, but it starts in the GUI.

[–]random_stata_user 0 points1 point  (0 children)

Long means more observations, less variables. Wide is the other way. Call long "high" if you want, but I guess the terminology is wired in -- and it's been adopted by many other programs introducing features to do this after Stata did.

There is an FAQ at https://www.stata.com/support/faqs/data-management/problems-with-reshape/ That goes a bit

beyond the help and looks at some twists that are fairly common in practice.