I have got the following matrix.
* 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
I would like to reshape observations per isin and year such as the output after the reshape looks 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 |
Thank you very much,
Gianfranco
0 Response to Help with reshape
Post a Comment