All the values that I have for the variable bondratio (amount of company debt that is in the form of bonds) are for the years 2017-2019, but I want to study how this variable affected the impact of the COVID pandemic on stock prices in 2020 (i.e. if companies with a higher/lower bondratio were more/less resilient to the crisis).

Here is an example of my data for three different stocks:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double PERMNO float month double stock_price float bondratio
13688 684  61.88999938964844        .
13688 685              66.75        .
13688 686  66.36000061035156 .8182862
13688 687  67.05000305175781        .
13688 688  68.37999725341797        .
13688 689  66.37000274658203 .8085532
13688 690  67.69000244140625        .
13688 691  70.37999725341797        .
13688 692  68.08999633789063 .8222454
13688 693  57.77000045776367        .
13688 694   54.2400016784668        .
13688 695  44.83000183105469 .7425898
13688 696  42.43000030517578        .
13688 697  41.09000015258789        .
13688 698  43.93000030517578 .7249041
13688 699 46.099998474121094        .
13688 700  43.33000183105469        .
13688 701 42.560001373291016 .8167768
13688 702  43.08000183105469        .
13688 703  46.18000030517578        .
13688 704   46.0099983215332 .8127667
13688 705 46.810001373291016        .
13688 706   26.3799991607666        .
13688 707              23.75 .6926678
13688 708                 13        .
13688 709 17.030000686645508        .
13688 710 17.799999237060547 4.933464
13688 711 22.520000457763672        .
13688 712 17.100000381469727        .
13688 713 22.920000076293945 3.659187
13688 714   18.1299991607666        .
13688 715 10.449999809265137        .
13688 716                 10        .
13688 717  6.170000076293945        .
13688 718  7.460000038146973        .
13688 719 10.869999885559082        .
13688 720              15.21        .
13688 721               15.5        .
13688 722               8.99        .
13688 723              10.64        .
13688 724              11.86        .
13688 725               8.87        .
13688 726               9.35        .
13688 727               9.26        .
13712 684 13.670000076293945         .
13712 685 16.920000076293945         .
13712 686 15.949999809265137         .
13712 687 15.260000228881836         .
13712 688 16.229999542236328         .
13712 689 15.729999542236328         .
13712 690 15.960000038146973         .
13712 691 15.739999771118164         .
13712 692 16.299999237060547         .
13712 693 15.739999771118164         .
13712 694 16.690000534057617         .
13712 695              17.25  .9295753
13712 696  19.31999969482422         .
13712 697 19.549999237060547         .
13712 698 19.139999389648438  .9316249
13712 699 18.860000610351563         .
13712 700 20.690000534057617         .
13712 701 19.579999923706055  .9333118
13712 702 20.760000228881836         .
13712 703 20.829999923706055         .
13712 704   22.3799991607666  .9333699
13712 705 19.719999313354492         .
13712 706 19.399999618530273         .
13712 707   16.6200008392334  .9368091
13712 708  16.31999969482422         .
13712 709   16.3799991607666         .
13712 710 15.899999618530273  .9358506
13712 711 15.319999694824219         .
13712 712 13.479999542236328         .
13712 713 14.260000228881836  .9378165
13712 714 11.329999923706055         .
13712 715 11.720000267028809         .
13712 716 13.989999771118164         .
13712 717 12.260000228881836         .
13712 718   12.6899995803833         .
13712 719 12.609999656677246         .
13712 720              10.14         .
13712 721                9.4         .
13712 722               9.24         .
13712 723               8.55         .
13712 724               7.84         .
13712 725               7.82         .
13712 726                7.4         .
13712 727               7.57         .
13714 684 12.479999542236328         .
13714 685   12.9399995803833         .
13714 686 13.800000190734863   .171748
13714 687   14.0600004196167         .
13714 688 14.210000038146973         .
13714 689 13.369999885559082 .17461425
13714 690  13.34000015258789         .
13714 691 14.079999923706055         .
13714 692              14.75 .18139043
13714 693 14.319999694824219         .
13714 694  14.09000015258789         .
13714 695 13.420000076293945 .18119723
13714 696 12.989999771118164         .
13714 697 11.010000228881836         .
13714 698 12.420000076293945  .1810034
13714 699 12.890000343322754         .
13714 700 14.319999694824219         .
13714 701 14.510000228881836 .15326667
13714 702 14.539999961853027         .
13714 703 13.859999656677246         .
13714 704 13.899999618530273 .16861856
13714 705   12.4399995803833         .
13714 706 13.149999618530273         .
13714 707 12.720000267028809         .
13714 708 14.100000381469727         .
13714 709               13.5         .
13714 710 14.199999809265137         .
13714 711   14.5600004196167         .
13714 712 14.550000190734863         .
13714 713              13.75         .
13714 714 14.020000457763672         .
13714 715 13.300000190734863         .
13714 716 13.930000305175781         .
13714 717 13.949999809265137         .
13714 718  14.34000015258789         .
13714 719 13.699999809265137         .
13714 720              13.89         .
13714 721              12.57         .
13714 722               7.08         .
13714 723               9.43         .
13714 724               9.76         .
13714 725               10.3         .
13714 726               9.68         .
13714 727              10.71         .
end
format %tm month
PERMNO is the stock id

The months 720+ correspond to January 2020 and onwards

Any help will be much appreciated, as I am really scratching my head over this one!