I have 3 matrix with the dimension 235x7690. The 235 represent months, the first month is june 1995, and 7690 are the number of firms. The first matrix represents returns, the second and third matrix represent characteristics of the firms (market equity and the third book-to-market equity). Now I wand to sort all 7690 firms in portfolios. I want to create 6 portfolio (high and low market equity and high middle and low book-to-markt equity). So with the 2nd matrix I want to separete them in high and low and the third matrix in high medium and low (the borders are the 30th percentil and the 70th percentil). The porfoliosort shoud be done every June. The I want to calculate the return of the six porfolios.
Could someone help me? Thank you