Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • reshape in Stata

    Dear All,
    I have some issues about reshape. Here is the original matrix I have.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex clear input int(isin year) str3(last_name_0 last_name_1 last_name_2 last_name_3 last_name_4 last_name_5 last_name_6 last_name_7 last_name_8 last_name_9) 16 2006 "" "LMR" "LMR" "LMR" "" "" "" "" "" "" 16 2007 "" "LMR" "LMR" "LMR" "" "" "" "" "" "" 16 2008 "" "LMR" "LMR" "LMR" "" "" "" "" "" "" 16 2009 "" "LMR" "LMR" "LMR" "" "" "" "" "" "" 16 2010 "" "LMR" "LMR" "LMR" "" "" "" "" "" "" 16 2011 "" "LMR" "LMR" "LMR" "" "" "" "" "" "" 16 2012 "" "LMR" "LMR" "" "" "" "" "" "" "" 16 2013 "" "LMR" "LMR" "" "" "" "" "" "" "" end format %ty year
    Now, I would like to reshape it as follows:
    isin year last_name
    16 2006 LMR
    16 2006 LMR
    16 2006 LMR
    16 2007 LMR
    16 2007 LMR
    16 2007 LMR
    16 2008 LMR
    16 2008 LMR
    16 2008 LMR
    16 2009 LMR
    16 2009 LMR
    16 2009 LMR
    16 2010 LMR
    16 2010 LMR
    16 2010 LMR
    16 2011 LMR
    16 2011 LMR
    16 2011 LMR
    16 2012 LMR
    16 2012 LMR
    16 2013 LMR
    16 2013 LMR
    Any help would be immensely appreciated.
    Thank you so much,
    Gianfranco

  • #2
    Duplicate post. Please follow https://www.statalist.org/forums/for...p-with-reshape if interested.

    Comment

    Working...
    X