store constant and coefficient of rolling regression
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
store constant and coefficient of rolling regression
I would like to store the constant and coefficient of each rolling regression.
Could you please help me?
Could you please help me?

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 12155
 Joined: Tue Sep 16, 2008 5:38 pm
Re: store constant and coefficient of rolling regression
What have you done so far?
Follow us on Twitter @IHSEViews
Re: store constant and coefficient of rolling regression
I found the solution to store the constant and coefficient.
But I don't know how to store the probability/tvalue for each coefficient.
But I don't know how to store the probability/tvalue for each coefficient.

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 12155
 Joined: Tue Sep 16, 2008 5:38 pm
Re: store constant and coefficient of rolling regression
What have you done so far?
Follow us on Twitter @IHSEViews
Re: store constant and coefficient of rolling regression
My regression equation: strategy_rate_!j = alpha + beta*actual_rate_!j
This is my code:
========
for !j=1 to 28
genr strategy_rate_!j = strategy_return_!j  rate_!j
genr actual_rate_!j = return_!j  rate_!j
equation eq!j.ls strategy_rate_!j c actual_rate_!j
matrix(2,28) alpha_beta
colplace(alpha_beta,eq!j.@coefs,!j)
next
=========
I want to save value of alpha, beta, and its tvalue. But I just wrote code to save alpha and beta.
This is my code:
========
for !j=1 to 28
genr strategy_rate_!j = strategy_return_!j  rate_!j
genr actual_rate_!j = return_!j  rate_!j
equation eq!j.ls strategy_rate_!j c actual_rate_!j
matrix(2,28) alpha_beta
colplace(alpha_beta,eq!j.@coefs,!j)
next
=========
I want to save value of alpha, beta, and its tvalue. But I just wrote code to save alpha and beta.
Re: store constant and coefficient of rolling regression
Could you please help to show me how to save the tvalue for each coefficient of the regression?

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 12155
 Joined: Tue Sep 16, 2008 5:38 pm
Re: store constant and coefficient of rolling regression
Do exactly the same thing, but rather than use:
use
Code: Select all
eq!j.@coefs
use
Code: Select all
eq!j.@tstats
Follow us on Twitter @IHSEViews
Re: store constant and coefficient of rolling regression
thanks so much for your help!
Re: store constant and coefficient of rolling regression
I have one more question.
The code "@coefs" is to save all coefficients of the regression.
Can we save only one coefficient and tstat at a time?
The code "@coefs" is to save all coefficients of the regression.
Can we save only one coefficient and tstat at a time?

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 12155
 Joined: Tue Sep 16, 2008 5:38 pm
Re: store constant and coefficient of rolling regression
thanks so much for your help!
Re: store constant and coefficient of rolling regression
This is my code to extract the coefficients and tstat of the regression in a table.
========
for !j=1 to 28
genr strategy_rate_!j = strategy_return_!j  rate_!j
genr actual_rate_!j = return_!j  rate_!j
equation eq!j.ls strategy_rate_!j c actual_rate_!j
matrix(28,4) alpha_beta
alpha_beta(!j,1) = eq!j.@coefs(1)
alpha_beta(!j,2) = eq!j.@tstats(1)
alpha_beta(!j,3) = eq!j.@coefs(2)
alpha_beta(!j,4) = eq!j.@tstats(2)
next
========
Eviews shows an error: "Division by zero in ALPHA_BETA(21,2) = EQ21.@tstat(1)"
What is the problem? How can I fix it?
Thanks!
========
for !j=1 to 28
genr strategy_rate_!j = strategy_return_!j  rate_!j
genr actual_rate_!j = return_!j  rate_!j
equation eq!j.ls strategy_rate_!j c actual_rate_!j
matrix(28,4) alpha_beta
alpha_beta(!j,1) = eq!j.@coefs(1)
alpha_beta(!j,2) = eq!j.@tstats(1)
alpha_beta(!j,3) = eq!j.@coefs(2)
alpha_beta(!j,4) = eq!j.@tstats(2)
next
========
Eviews shows an error: "Division by zero in ALPHA_BETA(21,2) = EQ21.@tstat(1)"
What is the problem? How can I fix it?
Thanks!

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 12155
 Joined: Tue Sep 16, 2008 5:38 pm
Re: store constant and coefficient of rolling regression
Sounds like equation 21 didn't estimate properly.
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 6 guests