I am running a loop to obtain residuals from a number of regressions. I have got 1939 y values(dependent variables). I need a series of residuals for each. I use the following code.
for i=1:1939 stats= regstats(y(:,i),x,'linear', {'beta', 'r'});end
However, I get only one column of residuals when I checked the stats. I doubt the residuals overwrite on only one column after each regression. Any ideas to solve this problem? Thanks.
Best Answer