I got the stuck the problem of running spline regression on my panel data. Initially, I tried cubic spline on my data but the regression output is very bad fit and there is a lot of outliers. However, I am not sure which spline model works best for my data, I tried also smooth spline on my data, but nothing is getting better. So I come here to get a possible idea on that. In particular, which regression spline I may try on my panel data and how can I get better fit on this panel data? Any concrete and solid idea on my question?
Here is the specification of panel data: at the first row shown below are my dependent variables which presented in natural log terms and independent variables: average temperature, total precipitation and 11 temperature bins and each bin-width (AKA, bin's window) is 3-degree Celsius. (<-6, -6~-3,-3~0,...>21).
Basically, I want to fit split regression on my data (let's say, choose one dependent variable such as ln_gdp_percapita, and multiple independent variable such as bin1 ~ bin10), I want to see the spline regression can fit better on my panel data. But now I can't figure out why my fitted output so bad.
Here is example panel data snippets can be copied into `excel` file and can be run in Stata:
and here is my regression output which is very bad for me, please take a look:

Ideally, I need better spline which can better fit on my data. Here is my wanted regression output:

For me, any kind of regression which can better fit on my data is sufficient. Any solid idea on my question?
Here is the specification of panel data: at the first row shown below are my dependent variables which presented in natural log terms and independent variables: average temperature, total precipitation and 11 temperature bins and each bin-width (AKA, bin's window) is 3-degree Celsius. (<-6, -6~-3,-3~0,...>21).
Basically, I want to fit split regression on my data (let's say, choose one dependent variable such as ln_gdp_percapita, and multiple independent variable such as bin1 ~ bin10), I want to see the spline regression can fit better on my panel data. But now I can't figure out why my fitted output so bad.
Here is example panel data snippets can be copied into `excel` file and can be run in Stata:
Code:
index year nuts_name ln_gdp_percapita ln_gva_agr_perworker ln_gva_em_perworker ln_gva_cons_perworker ln_gva_dist_perworker ln_gva_fin_perworker ln_gva_nonmark_perworker temp prec prec100 nuts_id bin1 bin2 bin3 bin4 bin5 bin6 bin7 bin8 bin9 bin10 bin11 de111 1980 Stuttgart, Stadtkreis 3.443704 2.036288 3.267888 3.137077 3.082345 3.879716 3.585174 8.862431 655.6 6.556 de111 10 10 28 45 55 43 52 54 38 24 7 de111 1981 Stuttgart, Stadtkreis 3.481725 2.022076 3.188755 3.099422 3.119275 3.892662 3.581378 9.583781 849.6 8.496 de111 5 14 40 38 40 22 54 64 44 30 14 de111 1982 Stuttgart, Stadtkreis 3.545516 2.267681 3.150235 3.073822 3.100677 3.905274 3.557841 9.98537 794.1 7.941 de111 7 13 15 39 53 53 43 36 52 37 17 de111 1983 Stuttgart, Stadtkreis 3.626141 2.138615 3.223052 3.114146 3.158287 3.940364 3.53808 10.07422 808.7 8.087 de111 3 17 29 38 45 40 48 46 34 38 27 de111 1984 Stuttgart, Stadtkreis 3.684978 2.410286 3.203391 3.101511 3.198802 3.955857 3.591974 8.962295 717.8 7.178 de111 1 9 23 67 55 36 48 57 46 18 6 de111 1985 Stuttgart, Stadtkreis 3.732419 2.406888 3.279514 3.107647 3.197114 3.946136 3.509635 8.735041 678 6.78 de111 27 11 24 36 53 33 32 54 49 36 10 de111 1986 Stuttgart, Stadtkreis 3.785341 2.659435 3.47186 3.24762 3.243426 4.039428 3.562429 9.22126 879.3 8.793 de111 16 10 24 45 41 47 47 50 32 33 20 de111 1987 Stuttgart, Stadtkreis 3.814674 2.630838 3.604336 3.339925 3.251627 4.092345 3.562793 8.896849 812.8 8.128 de111 13 19 30 38 32 54 43 49 44 26 17 de111 1988 Stuttgart, Stadtkreis 3.833437 2.891356 3.600405 3.398345 3.336716 4.12587 3.517508 10.19284 932.8 9.328 de111 1 2 23 50 49 44 46 55 54 31 11 de111 1989 Stuttgart, Stadtkreis 3.836867 2.942866 3.604008 3.463536 3.382585 4.163869 3.54217 10.38375 625.1 6.251 de111 0 10 31 32 42 44 58 51 42 44 11 de111 1990 Stuttgart, Stadtkreis 3.876456 3.103234 3.708044 3.516409 3.436605 4.211224 3.54022 10.49575 788.9 7.889 de111 0 4 26 34 47 50 56 62 43 25 18 de111 1991 Stuttgart, Stadtkreis 3.897659 3.210014 4.092638 4.051353 3.832299 4.678628 3.839186 9.680164 548.3 5.483 de111 7 16 25 48 37 44 58 35 33 39 23 de111 1992 Stuttgart, Stadtkreis 3.885848 2.979214 4.076821 3.971901 3.789868 4.624136 3.803127 10.43615 794 7.94 de111 1 12 14 40 58 60 28 40 51 35 27 de111 1993 Stuttgart, Stadtkreis 3.801015 3.056502 4.029931 3.87738 3.688005 4.554346 3.722416 9.924466 818.3 8.183 de111 4 15 27 33 47 41 42 57 54 27 18 de111 1994 Stuttgart, Stadtkreis 3.79825 3.032449 4.14937 3.897591 3.714159 4.530776 3.739223 11.28066 817.9 8.179 de111 0 6 13 24 55 59 56 49 41 26 36
Ideally, I need better spline which can better fit on my data. Here is my wanted regression output:
For me, any kind of regression which can better fit on my data is sufficient. Any solid idea on my question?