Is there a way (command/code) in Stata to drop the last "row-wise varlist" in each row (observation) instead of dropping the variable name?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str5 var11 str15 var12 str28 var13 str14 var18 str18 var19 str13 var110 str10(var111 var112) str2 var113 "85111" "Adelschlag" "Eichstätter" "" "" "" "" "" "" "83404" "Ainring" "Bundesstraße" "innerorts" "50" "" "" "" "" "83404" "Ainring" "Bundesstraße" "innerorts" "50" "" "" "" "" "83404" "Ainring" "Ulrichshögler" "50" "" "" "" "" "" "83544" "Albaching" "Kreisstraße" "Kreisstraße" "außerorts" "70" "" "" "" "82239" "Alling" "Bundesstraße" "Eichenau" "Bundesstraße" "außerorts" "80" "" "" "83352" "Altenmarkt" "Bundesstraße" "außerorts" "100" "" "" "" "" "86972" "Altenstadt" "Franz-Josef-Strauß-Straße/" "" "" "" "" "" "" "84503" "Altötting" "Fabrikstraße" "" "" "" "" "" "" "84503" "Altötting" "Staatsstraße" "außerorts" "80" "" "" "" "" "82346" "Andechs" "Herrschinger" "Staatsstraße" "innerorts" "50" "" "" "" "82346" "Andechs" "Kreissstraße" "Strecke" "Andechs-Rothenfeld" "Kreisstraße" "außerorts" "100" "" "82387" "Antdorf" "Iffeldorfer" "50" "" "" "" "" "" "86561" "Aresing" "St" "-" "Aresing" "Staatsstraße" "außerorts" "100" "" "84544" "Aschau" "a.Inn" "" "" "" "" "" "" "83229" "Aschau" "i." "Kiesgrube" "Fellerer" "Staatsstraße" "außerorts" "100" "" "83229" "Aschau" "i." "Stein" "Staatsstraße" "außerorts" "70" "" "" "85609" "Aschheim" "Eichendorffstraße" "" "" "" "" "" "" "83623" "Ascholding" "Staatsstraße" "" "" "" "" "" "" "84072" "Au" "(Dellnhausen)" "50" "" "" "" "" "" "84072" "Au" "(Hinkirchen)" "60" "" "" "" "" "" "85107" "Baar-Ebenhausen" "Münchener" "Straße" "innerorts" "50" "" "" "" "83043" "Bad" "Aibling" "50" "" "" "" "" "" "83043" "Bad" "Aibling" "30" "" "" "" "" "" "83043" "Bad" "Aibling" "innerorts" "50" "" "" "" "" "83043" "Bad" "Aibling" "Am" "Brand" "sonstige" "Straße" "außerorts" "60" "83043" "Bad" "Aibling" "18" "sonstige" "Straße" "innerorts" "50" "" "83093" "Bad" "Endorf" "Staatsstraße" "außerorts" "100" "" "" "" "83093" "Bad" "Endorf" "Hartmannsberg" "Staatsstraße" "außerorts" "70" "" "" "83075" "Bad" "Feilnbach" "ST" "2089" "Staatsstraße" "innerorts" "50" "" "83670" "Bad" "Heilbrunn" "50" "" "" "" "" "" "83435" "Bad" "Reichenhall" "HEM-Tankstelle" "Bundesstraße" "außerorts" "60" "" "" "83435" "Bad" "Reichenhall" "Nesselgraben" "Staatsstraße" "außerorts" "60" "" "" "83435" "Bad" "Reichenhall" "-" "Feuerwehrhaus" "Staatsstraße" "innerorts" "50" "" "83646" "Bad" "Tölz" "50" "" "" "" "" "" "83646" "Bad" "Tölz" "Bundesstraße" "innerorts" "50" "" "" "" "83646" "Bad" "Tölz" "" "" "" "" "" "" "83707" "Bad" "Wiessee" "Bayersäge" "Bundesstraße" "außerorts" "70" "" "" "83707" "Bad" "Wiessee" "innerorts" "50" "" "" "" "" end
I am using a complicated dataset, and I am trying to rearrange vars. What I need is to drop the last observation in each row. I could not do this using, for example, drop var113, since the observations of var113 are by error listed under var112, var111, var110...etc.
Thank you.
0 Response to Drop - last observation in each row
Post a Comment