I used Hausman test and as my prob < 5%. I choose to use FEM. But after testing I found out that there is Autocorrelation and Hereroskedasticity in my panel data. How can I fix it now? Thanks.



Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte ID str9 Country int Year double(ExchangerateofUSDinotherfo Inflation Interestrate Publicdebtborrowing BalanceofPayment)
1 "Vietnam"   2001 .0000674   -.43    5.3                 .           6.820e+08
1 "Vietnam"   2002 .0000655   3.83    6.4                 .          -6.040e+08
1 "Vietnam"   2003 .0000645   3.23    6.6                 .          -1.931e+09
1 "Vietnam"   2004 .0000636   7.75    6.2                 .          -9.570e+08
1 "Vietnam"   2005 .0000631  8.285  7.145                 .          -560189000
1 "Vietnam"   2006 .0000625  7.418   7.63                 .          -163741800
1 "Vietnam"   2007  .000062  8.344  7.493                 .         -6.9531e+09
1 "Vietnam"   2008 .0000594 23.115  12.73                 .         -1.0823e+10
1 "Vietnam"   2009 .0000563  6.717   7.91                 .          -6.608e+09
1 "Vietnam"   2010 .0000525  9.207 11.194              44.6          -4.276e+09
1 "Vietnam"   2011 .0000488 18.678 13.994              43.2           2.360e+08
1 "Vietnam"   2012 .0000479  9.095 10.504              39.4           9.429e+09
1 "Vietnam"   2013 .0000472  6.593   7.14              42.6           7.745e+09
1 "Vietnam"   2014 .0000469  4.085  5.758              46.4           9.359e+09
1 "Vietnam"   2015 .0000459   .631  4.748              49.2          -2.041e+09
1 "Vietnam"   2016 .0000449  2.668  5.035              52.7           6.250e+08
1 "Vietnam"   2017 .0000441   3.52  4.809              51.7          -1.649e+09
1 "Vietnam"   2018 .0000436   3.54  4.738              49.9          5899353000
1 "Vietnam"   2019 .0000429  2.796  4.975                48         13101247000
1 "Vietnam"   2020 .0000431  3.221   4.12              49.9          1.4932e+10
1 "Vietnam"   2021 .0000435   2.03    6.9                 .          -3.812e+09
2 "Japan"     2001  .007592   -.74     .1        102.742292      86219920754.33
2 "Japan"     2002  .008418   -.92      0        111.762727     108861295892.02
2 "Japan"     2003  .009312   -.26      0        122.004315     139380520054.08
2 "Japan"     2004  .009762   -.01     .1        127.804751     181993749574.64
2 "Japan"     2005  .008475   -.28     .3        128.408952     170122750083.95
2 "Japan"     2006  .008396    .25     .7        128.802258     174672769353.09
2 "Japan"     2007  .008973    .06     .8         132.32828      211735646402.3
2 "Japan"     2008  .011039   1.38     .6        138.522515     142115935666.07
2 "Japan"     2009   .01076  -1.35     .4        157.129231     145677709652.34
2 "Japan"     2010  .012311   -.72     .5         160.63447     220887986144.05
2 "Japan"     2011   .01299   -.27     .5        175.800007     129596684408.63
2 "Japan"     2012  .011522   -.05     .5        183.974575      60116999697.11
2 "Japan"     2013  .009494    .35     .5        186.830033      46378535980.11
2 "Japan"     2014  .008354   2.76     .4        192.578627      36351469239.97
2 "Japan"     2015   .00831    .79     .4        194.823099     136471801667.02
2 "Japan"     2016  .008553   -.12     .3        193.393931     197049392532.18
2 "Japan"     2017  .008873    .47     .3           234.575      203168727082.4
2 "Japan"     2018  .009125    .98   -.14           236.662     177268535276.42
2 "Japan"     2019  .009205    .48   -.19           238.012     176233817606.75
2 "Japan"     2020  .009683   -.02   -.16           266.258     148932280609.21
2 "Japan"     2021  .008687    -.2   -.11                 .        1.413183e+11
3 "Australia" 2001    .5106   4.41    3.7 .0277610651415305      -7986938465.21
3 "Australia" 2002    .5609   2.98    3.7 .0259403715561179      -16002234756.2
3 "Australia" 2003    .7516   2.73    3.5 .0251336431944773     -29307731701.37
3 "Australia" 2004    .7819   2.34    3.9 .0229095605140173     -41286950910.19
3 "Australia" 2005    .7333   2.69    3.9 .0224532197549398     -43342943309.56
3 "Australia" 2006     .789   3.56    4.1 .0216037883249402     -45318593059.68
3 "Australia" 2007    .8757   2.33    4.5 .0203000322704317     -64163007801.92
3 "Australia" 2008    .7073   4.35    4.7 .0183780949399148      -52121667002.2
3 "Australia" 2009    .8972   1.77    3.1 .0240545575135585     -48898407698.76
3 "Australia" 2010   1.0203   2.92    4.2 .0292203755129108     -44714246092.16
3 "Australia" 2011   1.0225    3.3    4.3 .0305593209102488     -44431156054.12
3 "Australia" 2012   1.0393   1.76    3.9 .0398985467434411     -64482910032.18
3 "Australia" 2013    .8913   2.45    3.3 .0380356326971065     -51314570187.13
3 "Australia" 2014    .8168   2.49    2.9 .0422069208840745     -45400874920.36
3 "Australia" 2015    .7275   1.51    2.3  .046988338517515      -56958711794.5
3 "Australia" 2016    .7215   1.28    2.1 .0547463902749761     -41185888415.55
3 "Australia" 2017    .7801   1.95      2                 .     -36063498746.16
3 "Australia" 2018    .7049   1.91      2                 .     -29892362779.74
3 "Australia" 2019    .7021   1.61    1.6                 .        7658429874.8
3 "Australia" 2020    .7694    .85     .8                 .      36212053243.93
3 "Australia" 2021     .726   2.82     .1                 .         54653464224
4 "France"    2001    .6024  1.634   4.88              58.3         21694720000
4 "France"    2002    .7236  1.943   4.44              60.3         17180850000
4 "France"    2003    .8061  2.099   4.64              64.4         15397160000
4 "France"    2004    .8775  2.142   4.87              65.9         11278950000
4 "France"    2005    .7612  1.746   2.85              67.4          2281820000
4 "France"    2006    .8205  1.676   3.73              64.6          5874250000
4 "France"    2007    .8818  1.487    4.6              64.5         -2707790000
4 "France"    2008    .9363  2.817   5.62              68.8        -2.02827e+10
4 "France"    2009    .9654   .091   7.36                83        -1.47944e+10
4 "France"    2010   1.0701  1.531   5.52              85.3 -16614900000.000002
4 "France"    2011   1.0656  2.111   5.05              87.8        -2.45996e+10
4 "France"    2012   1.0923  1.956   5.03              90.6        -2.59021e+10
4 "France"    2013   1.1194   .864      5              93.4         -1.4333e+10
4 "France"    2014   1.0056   .508   5.46              94.9         -2.7271e+10
4 "France"    2015    .9977   .037   4.91              95.6         -8976630000
4 "France"    2016    .9814   .183   5.11                98        -1.20173e+10
4 "France"    2017   1.0263  1.033      5              98.1        -1.98533e+10
4 "France"    2018   1.0185   1.85      5              97.8        -2.31824e+10
4 "France"    2019   1.0328  1.109   4.75              97.4         -7931960000
4 "France"    2020   1.1293   .479   3.75             114.6        -4.98358e+10
4 "France"    2021   1.0958  1.642      4             112.9         -1.7197e+10
end