Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double total_assets str38 country float year str130 name float ratio_noncore_liabilities
  .107 "GERMANY"        2000 "A&A Actienbank AG"                      .6261683
 1.776 "UNITED KINGDOM" 2006 "ABC International Bank Plc"             .9076577
 1.528 "UNITED KINGDOM" 2000 "ABC International Bank Plc"             .9489529
 1.237 "UNITED KINGDOM" 2003 "ABC International Bank Plc"             .8924818
 2.091 "UNITED KINGDOM" 2007 "ABC International Bank Plc"             .9340029
 1.971 "UNITED KINGDOM" 2005 "ABC International Bank Plc"             .9091831
 1.268 "UNITED KINGDOM" 2002 "ABC International Bank Plc"              .818612
 1.413 "UNITED KINGDOM" 2001 "ABC International Bank Plc"             .9271054
 1.915 "UNITED KINGDOM" 2004 "ABC International Bank Plc"             .9389034
  .489 "BELGIUM"        2005 "ABK Bank"                               .4764826
  .482 "BELGIUM"        2002 "ABK Bank"                               .4813278
   .52 "BELGIUM"        2007 "ABK Bank"                               .4884615
  .491 "BELGIUM"        2004 "ABK Bank"                               .4725051
  .478 "BELGIUM"        2000 "ABK Bank"                               .4916318
  .479 "BELGIUM"        2001 "ABK Bank"                               .4926931
  .485 "BELGIUM"        2003 "ABK Bank"                               .4804124
  .494 "BELGIUM"        2006 "ABK Bank"                              .48582995
   .88 "UNITED KINGDOM" 2005 "ABN AMRO (Guernsey) Limited"           .13977273
  .963 "UNITED KINGDOM" 2002 "ABN AMRO (Guernsey) Limited"           .08307373
  .659 "UNITED KINGDOM" 2000 "ABN AMRO (Guernsey) Limited"           .07587253
  .913 "UNITED KINGDOM" 2003 "ABN AMRO (Guernsey) Limited"           .08543264
  .943 "UNITED KINGDOM" 2006 "ABN AMRO (Guernsey) Limited"            .1399788
  .843 "UNITED KINGDOM" 2004 "ABN AMRO (Guernsey) Limited"           .11269277
 1.016 "UNITED KINGDOM" 2001 "ABN AMRO (Guernsey) Limited"           .11515748
  .141 "BELGIUM"        2000 "ABN AMRO Active Invest SA"             .19148937
  .102 "BELGIUM"        2002 "ABN AMRO Active Invest SA"              .1764706
  .126 "BELGIUM"        2005 "ABN AMRO Active Invest SA"             .22222222
  .124 "BELGIUM"        2003 "ABN AMRO Active Invest SA"              .1612903
  .118 "BELGIUM"        2001 "ABN AMRO Active Invest SA"             .16949153
  .156 "BELGIUM"        2004 "ABN AMRO Active Invest SA"              .1602564
 5.202 "LUXEMBOURG"     2001 "ABN Amro Bank (Luxembourg) SA"          .3083429
 6.389 "LUXEMBOURG"     2004 "ABN Amro Bank (Luxembourg) SA"          .4521834
 4.547 "LUXEMBOURG"     2000 "ABN Amro Bank (Luxembourg) SA"         .29447988
  6.37 "LUXEMBOURG"     2002 "ABN Amro Bank (Luxembourg) SA"          .4141287
 4.965 "LUXEMBOURG"     2003 "ABN Amro Bank (Luxembourg) SA"          .3204431
 6.634 "LUXEMBOURG"     2005 "ABN Amro Bank (Luxembourg) SA"           .268164
 7.965 "LUXEMBOURG"     2006 "ABN Amro Bank (Luxembourg) SA"          .5246704
  7.26 "LUXEMBOURG"     2007 "ABN Amro Bank (Luxembourg) SA"         .43677685
 2.621 "SWITZERLAND"    2000 "ABN Amro Bank (Schweiz) AG"             .7420832
 3.681 "SWITZERLAND"    2004 "ABN Amro Bank (Schweiz) AG"              .801141
 4.043 "SWITZERLAND"    2006 "ABN Amro Bank (Schweiz) AG"             .7959436
 3.173 "SWITZERLAND"    2001 "ABN Amro Bank (Schweiz) AG"             .7913646
 3.707 "SWITZERLAND"    2007 "ABN Amro Bank (Schweiz) AG"             .7984893
 3.366 "SWITZERLAND"    2003 "ABN Amro Bank (Schweiz) AG"             .7251931
 2.759 "SWITZERLAND"    2002 "ABN Amro Bank (Schweiz) AG"             .7847046
 3.702 "SWITZERLAND"    2005 "ABN Amro Bank (Schweiz) AG"             .7811993
14.937 "FRANCE"         2001 "ABN Amro France"                         .803508
 9.132 "FRANCE"         2005 "ABN Amro France"                         .695795
14.544 "FRANCE"         2002 "ABN Amro France"                        .8075495
 8.138 "FRANCE"         2004 "ABN Amro France"                        .7045957
15.928 "FRANCE"         2000 "ABN Amro France"                        .8151055
13.473 "FRANCE"         2003 "ABN Amro France"                         .802865
 9.412 "FRANCE"         2006 "ABN Amro France"                        .7269443
 3.627 "IRELAND"        2002 "ACCBank Plc"                           .54480284
 9.334 "IRELAND"        2005 "ACCBank Plc"                            .7156632
 3.336 "IRELAND"        2000 "ACCBank Plc"                            .3971823
 8.461 "IRELAND"        2004 "ACCBank Plc"                            .7071268
 8.828 "IRELAND"        2006 "ACCBank Plc"                            .7200952
 6.023 "IRELAND"        2003 "ACCBank Plc"                            .6935082
 3.314 "IRELAND"        2001 "ACCBank Plc"                            .3467109
 8.362 "IRELAND"        2007 "ACCBank Plc"                            .7792394
 5.528 "NETHERLANDS"    2007 "AEGON Bank NV"                         .08918235
  5.77 "NETHERLANDS"    2004 "AEGON Bank NV"                         .10138648
 6.975 "NETHERLANDS"    2002 "AEGON Bank NV"                         .10164875
 5.364 "NETHERLANDS"    2006 "AEGON Bank NV"                         .11148397
 5.525 "NETHERLANDS"    2005 "AEGON Bank NV"                          .0957466
 6.064 "NETHERLANDS"    2003 "AEGON Bank NV"                         .11477572
 2.184 "SWITZERLAND"    2001 "AEK Bank 1826"                          .3667582
 2.097 "SWITZERLAND"    2000 "AEK Bank 1826"                          .3619456
 2.285 "SWITZERLAND"    2006 "AEK Bank 1826"                           .297593
 2.271 "SWITZERLAND"    2004 "AEK Bank 1826"                          .3033906
 2.247 "SWITZERLAND"    2003 "AEK Bank 1826"                         .30885625
 2.197 "SWITZERLAND"    2002 "AEK Bank 1826"                          .3536641
 2.377 "SWITZERLAND"    2007 "AEK Bank 1826"                          .3289861
  2.29 "SWITZERLAND"    2005 "AEK Bank 1826"                         .28733623
   .25 "NETHERLANDS"    2006 "AFAB Financi�le Diensten Holding N.V"          .
   .44 "NETHERLANDS"    2007 "AFAB Financi�le Diensten Holding N.V"          .
  .971 "UNITED KINGDOM" 2003 "AIB Bank (CI) Limited"                 .08238929
  .978 "UNITED KINGDOM" 2001 "AIB Bank (CI) Limited"                 .06952965
 2.441 "UNITED KINGDOM" 2007 "AIB Bank (CI) Limited"                 .12453912
 1.011 "UNITED KINGDOM" 2004 "AIB Bank (CI) Limited"                 .08209693
 1.069 "UNITED KINGDOM" 2000 "AIB Bank (CI) Limited"                 .06173994
  .982 "UNITED KINGDOM" 2002 "AIB Bank (CI) Limited"                .074338086
  1.73 "UNITED KINGDOM" 2005 "AIB Bank (CI) Limited"                 .12774566
 2.497 "UNITED KINGDOM" 2006 "AIB Bank (CI) Limited"                 .09171005
 1.806 "IRELAND"        2004 "AIB Capital Markets Plc"                .9568107
 2.023 "IRELAND"        2003 "AIB Capital Markets Plc"                .9540287
 6.619 "UNITED KINGDOM" 2001 "AIB Group (UK) plc"                     .3302614
20.184 "UNITED KINGDOM" 2006 "AIB Group (UK) plc"                     .5217004
 13.25 "UNITED KINGDOM" 2004 "AIB Group (UK) plc"                    .50143397
  8.15 "UNITED KINGDOM" 2002 "AIB Group (UK) plc"                     .3555828
25.533 "UNITED KINGDOM" 2007 "AIB Group (UK) plc"                     .5505424
16.617 "UNITED KINGDOM" 2005 "AIB Group (UK) plc"                     .5300596
 9.849 "UNITED KINGDOM" 2003 "AIB Group (UK) plc"                     .3892781
 6.456 "UNITED KINGDOM" 2000 "AIB Group (UK) plc"                     .3607497
 1.937 "GERMANY"        2002 "AKA Ausfuhrkredit-GmbH"                 .9979349
 2.247 "GERMANY"        2007 "AKA Ausfuhrkredit-GmbH"                 .8963062
 2.118 "GERMANY"        2006 "AKA Ausfuhrkredit-GmbH"                  .996695
 2.365 "GERMANY"        2001 "AKA Ausfuhrkredit-GmbH"                 .9991543
  1.93 "GERMANY"        2003 "AKA Ausfuhrkredit-GmbH"                 .9440414
end
I need to do two things to these data:
1) finding the weighted ratio_noncore_liabitilies, using total_assets for the SPECIFIC country for the SPECIFIC year as the weight.
2) plotting the weighted average on a yearly basis, with a trendline for each country

I'm really stuck on how to separate the data, and I would really appreciate your help!