In the image there is the head of my data, what I want to know is if it id possible to plot these two regressions with a spline curve, together with the raw data of each hospital?
I mean, each plot should have the spline regression togheter with raw data of one group
fixed.dum <-lm(Ratio ~ Weeks + Comorbidity_Oncological+Comorbidity_Cardiological+Comorbidity_Diabetes+Comorbidity_Respiratory+InICU+ SymptomFirst+ SymptomWorst+LOS.D+Age + factor(Hospital) -1, data=mort_data)
fixed <-plm(Ratio ~ Weeks + Comorbidity_Oncological+Comorbidity_Cardiological+Comorbidity_Diabetes+Comorbidity_Respiratory+InICU+Age+SymptomFirst+ SymptomWorst + LOS.D, data=mort_data, index=c("Hospital", "Weeks"), model="within")
so I think the most dimensions you can work with EASILY here for a plot are three or four: the x and y axes as well as a third grouping variable that would separate some two dimensional simplified regression lines. Four if you separate graphs by a variable and then group by color within those graphs, but you get the point. But basically these panel and linear regressions you have above have solutions that are on high-dimensional hyperplanes not on spline regressions.
One package that you can use to plot panel data is panelr: https://rpubs.com/quarcs-lab/learn-panelr
If you go down to section 5 you see how you can plot original data as well as some regression data by variable. More details in the question would lead to more details in the answer on plotting. But I think this would allow you to see the effect of each variable for each hospital.
Also, in ggplot2 you can specify the model you use for drawing your statistical model overlay like so:
ggplot(data = , aes(x = , y = )+
geom_point()+
geom_smooth(y = )
just fill in the blanks, your model goes in the y equals space in the geom_smooth() call.
With respect to getting to know your data better instead of plotting it with a regression try... (I have not used this package, but it might help you get an understanding of your data): https://cran.r-project.org/web/packages/ExPanDaR/vignettes/use_ExPanD.html.