Trying to copy regression stats ina vector, getting error

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

sidbhotika
Posts: 4
Joined: Thu Dec 23, 2010 12:46 am

Trying to copy regression stats ina vector, getting error

Postby sidbhotika » Thu Dec 23, 2010 6:10 am

Hi

I am running the following code

Code: Select all

%ccy1 = "aud cad chf eur gbp jpy nok nzd sek" %ccy2 = "chf nok sek" pool ccy1 {%ccy1} pool ccy2 {%ccy2} scalar nc1 = ccy1.@ncross scalar nc2 = ccy2.@ncross for !i=1 to nc1 vector r2s %ccy1_name=ccy1.@idname(!i) equation eq1_{%ccy1_name} !flag = 0 for !j=1 to nc2 %ccy2_name=ccy2.@idname(!j) if %ccy1_name=%ccy2_name then !flag = 1 endif next if !flag =1 then eq1_{%ccy1_name}.ls s_{%ccy1_name} c c_{%ccy1_name} c_eur else eq1_{%ccy1_name}.ls s_{%ccy1_name} c c_{%ccy1_name} c_usd endif r2s(!i)=eq1_{%ccy1_name}.@r2 next
I am getting the error that "2 is not a valid index for vector series coefficient R@S in "R@S(@)=EQ1_CAD@R2"

Pl point out where i can change the code to rectify this.

sidbhotika
Posts: 4
Joined: Thu Dec 23, 2010 12:46 am

Re: Trying to copy regression stats ina vector, getting error

Postby sidbhotika » Thu Dec 23, 2010 6:10 am

I am using Eviews 6

sidbhotika
Posts: 4
Joined: Thu Dec 23, 2010 12:46 am

Re: Trying to copy regression stats ina vector, getting error

Postby sidbhotika » Thu Dec 23, 2010 8:20 am

k, i managed to clear the vector problem.

BradleyMorris
Posts: 18
Joined: Wed Dec 29, 2010 6:00 am

Re: Trying to copy regression stats ina vector, getting error

Postby BradleyMorris » Wed Dec 29, 2010 6:28 am

Hello,

the problem I'm running into seems to me like a eviews rookie problem, nonetheless its something I would love some help with.

I'm trying to run a multiple regression analysis with a number of firm characteristics which I want to place in a vector as the first variable.
-This is my problem: how to select several variables as 1 vector?

My final regression formula should look like this, to draw a clearer picture for you:

Dependent variable= c + b*Xi +b2*Xii +b3*Xi*Xii

--The last part of the regression is a interaction variable, but the topic of discussion is how do I plug several characteristics into the independent variable Xi and use it as a Vector?

thank you very much in advance.!

BradleyMorris
Posts: 18
Joined: Wed Dec 29, 2010 6:00 am

Re: Trying to copy regression stats ina vector, getting error

Postby BradleyMorris » Wed Dec 29, 2010 6:44 am

This is the formula I tried entering in eviews 7.1

return=c(1)+c(2)*ppeass me earningsbookequity earnings_ii earnings div age+c(3)*sentiment_i+c(4)*ppeass me earningsbookequity earnings_ii earnings div age*sentiment_i

To break it down more clearly:

return=c(1)+c(2)*ppeass me earningsbookequity earnings_ii earnings div age+c(3)*sentiment_i+c(4)*ppeass me earningsbookequity earnings_ii earnings div age*sentiment_i

The bold section is what I would like Eviews to view as 1 variable of which 1 coefficient is outputted.

A second question while I'm at it: is the way a denoted the interaction variable understandable for EViews?

Thanks again.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Trying to copy regression stats ina vector, getting error

Postby EViews Gareth » Wed Dec 29, 2010 8:57 am

It really isn't clear to me what you're trying to do. Could you define what you mean when you say you want EViews to treat multiple variables as one variable?

BradleyMorris
Posts: 18
Joined: Wed Dec 29, 2010 6:00 am

Re: Trying to copy regression stats ina vector, getting error

Postby BradleyMorris » Thu Dec 30, 2010 2:25 am

Hi,

maybe my initial intention was not correct. I am not sure whether I want Eviews to treat several variables as 1 variable, but I want to be able to assess the difference of the influence of 1 independent variable (sentiment) on the dependent variable (return), after controlling for different firm characteristics.

So what I want to do for example:

test whether the returns of small and big firms are differently influenced by sentiment. The fashion in which the prior research did this, is with the multiple regression formula I denoted earlier, with the interaction variable. They first test whether the interaction coefficient is significantly different from zero. Then they view the coefficient of the characteristic to say whether or not the influence differs across different groups (small vs big firms).

I just realized that one option to solve this might be to select only three variables: the return(dependent),1 group of firm characteristics (instead of all in one), say small firms, and then sentiment (2nd independent) and finally to add the interaction variable.. Thereafter I could run the same analysis, but this time with big firms and then compare the differences. Do you think this would work? Or is there a more efficient way of sorting, so I don't have to run several different regressions?

-But-if I would do this, I would have to know how to determine whether the difference of the influence of sentiment across big vs small firms is significant.. Would you by any chance know about this too?

I hope my situation has become more clear, if not, don't hesitate to comment, I'm very glad of the possibility of help.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests