I have to make a double sorted portfolio analysis.

First I need to regress a simple linear model with 4 independent variables, and find the error term.

I need to do this for around 100 persons in a sample, in a quarterly time span for 6 years.

From the error term I should then estimate the standard deviation.

Then I need to categorize the standard deviations of the error terms into four portfolios, from low to high.

How could I estimate the error for all persons at every different time all at once?

The data that I use is in Excel and looks like this:

Dates Name Variable1 Variable2 ... etc

Q12013 X 100

Q22013 X 103

Q32013 X 122

Q42013 X 98

Q12014 X 128

.......

.....

Q12013 Y 110

Q22013 Y 105

Q32013 Y 132

Q42013 Y 39

Q12014 Y 138

.......

.....

Q12013 Z 87

Q22013 Z 115

Q32013 Z 139

Q42013 Z 87

Q12014 Z 132

First I need to regress a simple linear model with 4 independent variables, and find the error term.

I need to do this for around 100 persons in a sample, in a quarterly time span for 6 years.

From the error term I should then estimate the standard deviation.

Then I need to categorize the standard deviations of the error terms into four portfolios, from low to high.

How could I estimate the error for all persons at every different time all at once?

The data that I use is in Excel and looks like this:

Dates Name Variable1 Variable2 ... etc

Q12013 X 100

Q22013 X 103

Q32013 X 122

Q42013 X 98

Q12014 X 128

.......

.....

Q12013 Y 110

Q22013 Y 105

Q32013 Y 132

Q42013 Y 39

Q12014 Y 138

.......

.....

Q12013 Z 87

Q22013 Z 115

Q32013 Z 139

Q42013 Z 87

Q12014 Z 132

## Comment