
Hi there,

I have a huge data set with multiple firms years and other firm characteristics. I want to run a regression on the dependent variable and other explanatory variables and calculate the residual terms by grouping the firms in same year and same industry. 

What I want to do is to divide my obseravtion into sub sample that contains the observation with same fiscal year(FYEAR=1990) and same firm characteristic (Industry =1) and run the regression and put the residual back to the observation by creating a new column. I want to do that for multiple years and multiple firms. I wonder is that any easy command with out creating multiple loops?

Ray

 		 	   		  
	[[alternative HTML version deleted]]

