[R] R-help mailing list

Saba Sehrish sabasehrish at yahoo.com
Thu Dec 3 22:51:54 CET 2015


Hi


 
I am a PhD student and I want to learn how to run Linear regression with Lag-5 on R through "For Loop". Please find the details below:


 
1-            I need guidance about Coding/ Programming for Simple Linear Regression with Lag-5 on R.

2-           I have time series data of “Daily Returns” of 15 stocks and I want to see how each stock’sreturn is connected to all other stocks’ returns. This means, I have to runregression as follows:


 
                    a) Impact of Stock 1’s return on return of Stock 2. Impact of Stock 1’s return onreturn of Stock 3. Impact of Stock 1’s return on return of Stock 4 ……… tillreturn of Stock 15.                    b) Then, Impact of Stock 2’s return on return of Stock 1. Impact of Stock 2’sreturn on return of Stock 3. Impact of Stock 2’s return on return of Stock 4……… till return of Stock 15. And this will continue till Stock 15, one after another.                    c)  As the the process will have to be repeated, therefore instead of manual coding everytime, “For Loop” is required. 



 
I shall bereally grateful for a detailed reply.


 
Thanks.


 
Regards

Saba Sehrish


	[[alternative HTML version deleted]]



More information about the R-help mailing list