Hi Statalisters,

I am a novice user in Stata. I'm working with Stata.14 and Windows 7.

I'm working on a Panel Data Set for all commerical banks (name2) in the U.S. for the period 1995 - 2018 (time variable). So I have data on a bank-year level. I created the ID Variable with the variables name2 and cert I already calculated four bank risk proxies: Z-Score, NPA (non-performing assets), LLP (loan loss provisions) and LLR (loan loss reserves) on a bank-year level. Here is the "Dataset 1":

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long name2 float date2 long cert int(year id) float(llr llp npa z_score)
  1 143 15448 2007  1 .011630812   .018261097  .015062087 -1.5716723
  2 143 23309 2014  2 .007704217    .00026063   .01757166 -1.6909508
  3 143 16419 2015  2 .004713984            0   .02558387  -1.714116
  4 143  4788 2016  2 .005010014   .000539208   .01931906 -1.9513158
  5 143 23406 2017  2 .005206013   .000905271   .01653177  -1.886552
  6 143 33619 2018  2 .005082208   .000445157  .012838008 -1.8675916
  7 143 27552 2014  3          0            0           0  -3.228743
  8 143  1673 2015  3          0            0           0  -3.197962
  9 143 19713 2006  4 .007627714   .000923452  .002693402 -1.8396757
 10 143  6646 2007  4 .007800257   .001282144  .001100233 -1.9295822
 11 143 26977 2008  4 .010616484   .003585204  .013777885  -1.963218
 12 143 20662 2009  4 .016729187   .016583314   .02593907 -1.9244528
 13 143 19593 2010  4 .014617286     .0030025  .017214797 -1.9180492
 14 143  9087 2011  4 .010910933   .002482072  .018298596  -1.586883
 15 143 22536 2005  6 .007931727   .007931727           0 -2.2908888
 16 143 22543 2006  6 .007908663    .00720697           0 -1.8879156
 17 143 27136 2007  6 .008464329   .000998414   .02762278 -1.6747932
 18 143  8841 2008  6 .008355642   .003057135  .019206095  -1.449307
 25 143 19795 2009  6  .02964397    .03421423   .09687161  -.8901772
 26 143 25002 2010  6 .029940894   .035797488    .1661957  -.1181851
 27 143 26668 2011  6 .021382164    .01136998   .17405207  -.9856699
 28 143 21109 2012  6  .01443208   .004534268    .1530683 -1.1408491
 29 143 14936 2013  6 .016162274   .005791808   .15281764 -1.3834363
 30 143 23064 2014  6 .012107523   .000682854   .13720109 -1.4684038
 31 143 18489 2015  6 .008448168   .001030842   .08406697 -1.4148947
 32 143 14311 2016  6 .007447635   .001197504   .06336267  -1.474553
end
format %tq!Qq-CCYY date2
label values name2 name2
label def name2 1 "1st American State Bank of Minnesota", modify
label def name2 2 "1st Bank", modify
label def name2 3 "1st Bank & Trust", modify
label def name2 4 "1st Bank of Troy", modify
label def name2 5 "1st Business Bank", modify
label def name2 6 "1st Choice Bank", modify
label def name2 7 "1st Constitution Bank", modify
label def name2 8 "1st Financial Bank South Dakota", modify
label def name2 9 "1st Floyd Bank", modify
label def name2 10 "1st National Bank", modify
label def name2 11 "1st National Community Bank", modify
label def name2 12 "1st Security Bank of Laurel", modify
label def name2 13 "1st Security Bank of West Yellowstone, Montana", modify
label def name2 14 "1st Source Bank", modify
label def name2 15 "1st State Bank and Trust Company of Palos Hills", modify
label def name2 16 "1st State Bank of Mason City", modify
label def name2 17 "1st United Bank", modify
label def name2 18 "21st Century Bank", modify
label def name2 25 "Abbotsford State Bank", modify
label def name2 26 "Abrams Centre National Bank", modify
label def name2 27 "Acadia State Bank", modify
label def name2 28 "Acadian Bank", modify
label def name2 29 "Ackley State Bank", modify
label def name2 30 "Adair State Bank", modify
label def name2 31 "Adams Bank & Trust", modify
label def name2 32 "Adams County Bank", modify
Now I would like to use the four calculated risk proxies (llr, llp, npa, z_score). I use a Probability Model explaining the occurrence of a bank failure (0/1) with the four proxies (lagged by one year). The dependent variable equals 1 if a bank failed and its equal 0 if a bank is active.
For the dependent variable I have the "Failed Bank List" provided by the FDIC. With the names of the failed banks (namefb), the status that they failed (failure), the certification number (certfb) and their failure date (datefb) (I will convert the string variable to a numeric variable). The failed banks from the "Failed Bank List" are also included in my first Dataset.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long(namefb failure certfb) str11 datefb
419 1 17719 "10/13/2017 "
145 1  1802 "5/26/2017 " 
184 1 58302 "4/28/2017 " 
341 1 35495 "03.03.2017" 
359 1 19328 "1/27/2017 " 
224 1 34951 "1/13/2017 " 
 14 1    91 "9/23/2016 " 
440 1 11297 "8/19/2016 " 
164 1 35312 "05.06.2016" 
447 1  9956 "4/29/2016 " 
303 1 20364 "03.11.2016" 
240 1 35156 "10.02.2015" 
411 1 35259 "10.02.2015" 
339 1 34112 "07.10.2015" 
138 1 57772 "05.08.2015" 
 71 1 33938 "2/13/2015 " 
234 1 20290 "1/23/2015 " 
178 1 17557 "1/16/2015 " 
304 1 34983 "12/19/2014 "
434 1   916 "10/24/2014 "
288 1  4862 "10/17/2014 "
137 1 58125 "7/18/2014 " 
430 1 12483 "6/27/2014 " 
454 1 21793 "6/20/2014 " 
454 1 10450 "6/20/2014 " 
 28 1 57866 "5/16/2014 " 
end
label values namefb namefailedbank2
label def namefailedbank2 14 "ALLIED BANK", modify
label def namefailedbank2 28 "AZTECAMERICA BANK", modify
label def namefailedbank2 71 "CAPITOL CITY BANK & TRUST COMPANY", modify
label def namefailedbank2 137 "EASTSIDE COMMERCIAL BANK", modify
label def namefailedbank2 138 "EDGEBROOK BANK", modify
label def namefailedbank2 145 "FAYETTE COUNTY BANK", modify
label def namefailedbank2 164 "FIRST CORNERSTONE BANK", modify
label def namefailedbank2 178 "FIRST NATIONAL BANK OF CRESTVIEW", modify
label def namefailedbank2 184 "FIRST NBC BANK", modify
label def namefailedbank2 224 "HARVEST COMMUNITY BANK", modify
label def namefailedbank2 234 "HIGHLAND COMMUNITY BANK", modify
label def namefailedbank2 240 "HOMETOWN NATIONAL BANK", modify
label def namefailedbank2 288 "NBRS FINANCIAL BANK", modify
label def namefailedbank2 303 "NORTH MILWAUKEE STATE BANK", modify
label def namefailedbank2 304 "NORTHERN STAR BANK", modify
label def namefailedbank2 339 "PREMIER BANK", modify
label def namefailedbank2 341 "PROFICIO BANK", modify
label def namefailedbank2 359 "SEAWAY BANK AND TRUST COMPANY", modify
label def namefailedbank2 411 "THE BANK OF GEORGIA", modify
label def namefailedbank2 419 "THE FARMERS AND MERCHANTS STATE BANK OF ARGONIA", modify
label def namefailedbank2 430 "THE FREEDOM STATE BANK", modify
label def namefailedbank2 434 "THE NATIONAL REPUBLIC BANK OF CHICAGO", modify
label def namefailedbank2 440 "THE WOODBURY BANKING COMPANY", modify
label def namefailedbank2 447 "TRUST COMPANY BANK", modify
label def namefailedbank2 454 "VALLEY BANK", modify
label values failure failure
label def failure 1 "FAILURE", modify
To run my regeression, my goal is to set up my Stata Dataset with the dependent variable with its binary outcome: Failure = 1 and Active = 0

How can I combine the two datasets?

Thank you so much for your input!