Hi all!

I am just starting my adventure with R, so excuse me naive questions.

My data look like that:

<http://r.789695.n4.nabble.com/file/n4681391/data_descr_img.jpg>

I have 3 independent variables (F.1, F.2 and F.3) and 334 other variables
(r.1, r.2, ... r.334) - each one of these will be dependent variable in my
regression.

Total span of the time is 154 observations. But I would like to have rolling
window regression with length of 31 observations.

I would like to run script like that:

summary(lm(r.1~F.1+F.2+F.3, data=data))
vif(lm(r.1~F.1+F.2+F.3, data=data))

But for each of 334 (r.1 to r.334) dependent variables separately and with
rolling-window of the length 31obs.

Id est:
summary(lm(r.1~F.1+F.2+F.3, data=data)) would be run 123 (154 total obs -
31. for the first regression) times for rolling-fixed period of 31 obs.

The next regression would be:
summary(lm(r.2~F.1+F.2+F.3, data=data)) also 123 times ... and so on till
summary(lm(r.334~F.1+F.2+F.3, data=data))

It means it would be 123 x 334 regressions (=41082 regressions)

I would like to save results (summary + vif test) of all those 41082
regressions in one read-user-friendly file like this given by e.g command
capture.output()

Could you help with it?

Regards,

T.S.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to