Estimation by sym

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Estimation by sym

Postby basil » Thu May 05, 2011 7:41 am

How do you estimate a regression by sym?

I am running a regression on financial market data that includes the columns: date, sym (ticker of the company), price, volume. For each sym, I would like, say, to run the following regression and collect the coefficients and R2: price c price(-1) volume
Note, that the data is not a balanced panel.

Thanks for the help.
Basile

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

Re: Estimation by sym

Postby EViews Gareth » Thu May 05, 2011 7:58 am

I'm not sure what you're asking here. But it seems to me you just need to write a program with a for loop, that loops over each "sym", and creates an equation for each one.

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: Estimation by sym

Postby basil » Thu May 05, 2011 8:48 am

Thanks very much Gareth for your quick response.

Agreed, a loop will do. I was thinking whether there is an option by EViews that would allow doing this straightforward whether having to go thru a loop.

The loop that i thought of, would loop over the different values of sym, and then restrict the sample to that sym, run the regression, and collect the needed coefficients into a table. When tried to do a loop, I stumbled upon two issues.

(1) Does EViews have a function that can allow me to create a distinct list of the sym saved into a table (say, named syms)? The sym column is type of alpha
(2) When I run a regression with "sample if sym=syms(1)" i get an error msg "Error in Sample: Illegal or index specification for series syms(1)

I appreciate your help and quick response.
Basile

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

Re: Estimation by sym

Postby EViews Gareth » Thu May 05, 2011 9:09 am

You can use one-way tabulation to get a list of unique values. It isn't the perfect interface, but it can be used.

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: Estimation by sym

Postby basil » Thu May 05, 2011 9:19 am

Thanks EViews Gareth.

What about the error?
(2) When I run a regression with "sample if sym=syms(1)" i get an error msg "Error in Sample: Illegal or index specification for series syms(1)

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

Re: Estimation by sym

Postby EViews Gareth » Thu May 05, 2011 9:24 am

What is syms?

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: Estimation by sym

Postby basil » Thu May 05, 2011 9:33 am

"syms" is a table of distinct "sym".

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

Re: Estimation by sym

Postby EViews Gareth » Thu May 05, 2011 9:39 am

Code: Select all

%val = syms(1,1) smpl if sym = %val

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: Estimation by sym

Postby basil » Thu May 05, 2011 10:03 am

thx v much for the help.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests