# Is it possible to generate a linear regression from another linear regression?

To provide context with the data, I have several variables $$X_1, X_2, \cdots, X_K$$ that represent $$K$$ individuals. When using all of these variables in a multiple regression (with ridge restriction) I get many IVs with coefficient equal to zero, but I wouldn't want that. So, the solution to resolve this was aggregating the data into known $$m$$ categories for the subjects. So, my disaggregated data would look like something like this:

$$\begin{array}{c|c|c|} & \text{Subject} & \text{Category} & \text{Value} \\ \hline \text{Row 1} & U_1 & C_1 & x_{1,1,1}\\ \hline \text{Row 2} & U_1 & C_1 & x_{1,1,2}\\ \hline \cdots & \cdots & \cdots & \cdots\\ \hline \text{Row n} & U_1 & C_1 & x_{1,1,n}\\ \hline \text{Row 1} & U_2 & C_1 & x_{1,2,1}\\ \hline \text{Row 2} & U_2 & C_1 & x_{1,2,2}\\ \hline \cdots & \cdots & \cdots & \cdots\\ \hline \text{Row n} & U_2 & C_1 & x_{1,2,n}\\ \hline \cdots & \cdots & \cdots & \cdots\\ \hline \text{Row 1} & U_K & C_m & x_{m,K,1}\\ \hline \text{Row 2} & U_K & C_m & x_{m,K,2}\\ \hline \cdots & \cdots & \cdots & \cdots\\ \hline \text{Row n} & U_K & C_m & x_{m,K,n}\\ \hline \end{array}$$

So instead of using $$X_1,X_2,\dots,X_K$$ I aggregated the data as follows

$$\begin{matrix} X'_1 = \sum_{U_p\in C_1}X_p & X'_2 = \sum_{U_p\in C_2}X_p & \cdots & X'_m = \sum_{U_p\in C_m}X_p \end{matrix}$$

And the adjust the next linear regression.

$$$$y_t = \beta'_0 + \sum_{i=1}^{m} \beta'_iT_i(X'_{i,t}) + \epsilon_t$$$$

The results give me a good insight of the aggregated variables but I still want to know a coefficient for each Individual. Thus, I took a new dependent variable made up from the multiplication of the beta associated with the aggregated category and the transformed $$X'_i$$; the independent variables now is built with the disaggregated data from the correspondent category. All of this expressed in the next equation for each category $$C_i$$

$$$$\beta'_iT_{i}(X_{i,t}; \vartheta_{i}) = \delta_{i,0} + \sum_{j=1}^{m_i}\beta_{i,j}T_{i,j}(X_{i,j,t}) + \varepsilon_{i,t}$$$$

So, at the end I have one "parent" multiple regression and $$m$$ "children" multiple regression models.

My question is if this methodology is valid from a statistical point of view, I'm afraid about the independence of error. In general I'm having problems with interpreting how the errors would work in this model, I understand that there wouldn't be much trouble with those giving that I'm only adding them up, but still I am not quite sure if the aggregation-disaggregation process is valid statistically.

You wrote:

When using all of these variables in a multiple regression (with ridge restriction) I get many IVs with coefficient equal to zero, but I wouldn't want that.

Mick Jagger et al said it best:

You can't always get what you want.

The fact that the ridge regression is making some coefficients 0 is telling you something.

Also, the way you have your disagregated data is not the usual way. I don't know how you are reading it in, but the usual way is to have each row be a subject and each column be a variable. Also, you have multiple row 1's which can't be a good thing.

Finally, I do not understand your aggregation scheme at all. You can, in some circumstances, combine variables (e.g. by adding them, or factor analysis, or PCA) but I don't know what these categories are, or how they are being used.

• "the usual way is to have each row be a subject and each column be a variable" That's how I used the data first before I started aggregating. The individuals are the $K$ $U_i$ for each of these I have n rows of values, take it as daily data of some metric I use to predict my dependet variable. So the table I wrote is more like the stacked data I had at the begging. Commented Aug 24, 2023 at 17:59
• "I don't know what these categories are, or how they are being used." The categories are groups of which these individual are part of, each individual $U_i$ is mapped to their respective category $C_j$ So individuals U and categories C have a Many to One relationship. Commented Aug 24, 2023 at 18:03