Can I merge multiple linear regressions into one regression? I have a dataset of 48,000 records
These records are divided equally into 4 groups
Blue Group, Yellow Group, Green Group, and Red Group
Each one of these groups has 12,000 records
My study has resulted in 4 regression models

Model 1 equation was $a_1 x + b_1$
Model 1 equation was $a_2 x + b_2$
Model 1 equation was $a_3 x + b_3$
Model 1 equation was $a_4 x + b_4$
The thing is that the dataset is not available anymore and I want the regression model for all dataset points
Can I get the average of all 4 models to get the regression for all data points?
So it will be $((a_1 + a_2 + a_3 + a_4)/4)  x + (b_1 + b_2 + b_3 + b_4)/4$
is this model the right model for all data points?

I tried it
set.seed(1)

x = 1:20
y = x + rnorm(20)

lm(y[1:10] ~ x[1:10])
lm(y[11:20] ~ x[11:20])
lm(y~x)

and it doesn't work. The coefficients of a regression, is not the same as the average of the coefficients of two half regressions.
Call:
lm(formula = y[1:10] ~ x[1:10])

Coefficients:
(Intercept)      x[1:10]  
    -0.1688       1.0547  


Call:
lm(formula = y[11:20] ~ x[11:20])

Coefficients:
(Intercept)     x[11:20]  
    -0.5036       1.0485  


Call:
lm(formula = y ~ x)

Coefficients:
(Intercept)            x  
   -0.03609      1.02158  


But while you do not get the exact same result as a single regression. The mean of 4 independent regressions does give you a more precise estimate. Since the average of multiple estimates will have less variance. So yes, you could use the average of the multiple regressions.
With some more information one could tell if there are smarter ways to combine the figures. E.g. when the data is not the same then the estimates can have different precision and for that case you could use a weighted estimate in which you do not count every result the same. (For instance, in the above example the intercept does not have the same error in the two splits because the vector $x$ is shifted. And this changes the error. Using the first more precise estimate of the intercept is better than using the average.)
Also, with some more information one might get to the conclusion that the groups are not to be averaged. If there is something meaningful different about the groups then they could have different regression lines which should not be grouped.
