Testing Capital Asset Pricing Model (CAPM)

For questions regarding programming in the EViews programming language.

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

persi868
Posts: 1
Joined: Tue Mar 17, 2009 8:04 am

Testing Capital Asset Pricing Model (CAPM)

Postby persi868 » Tue Mar 17, 2009 8:25 am

Hi there

I am new to eviews and would appreciate some step-by-step guidance as to how i can test the CAPM using c. 50 companies with weekly returns over 10 years.

I can run simple regression on each stock using the pooled data function, but i need to then store the Bi from each regression to use in subsequent regressions. I believe I need to store them as a vector but dont know how to do this.

1. Ri - Rf = ai + Bi (Rm - Rf)
2. ri = y0 + y1Bi + y2Bi^2

Can anyone help with this??

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

Re: Testing Capital Asset Pricing Model (CAPM)

Postby EViews Gareth » Tue Mar 17, 2009 8:37 am

I'm not sure I follow exactly what you want to do, but storing the coefficients from a regression into a vector is simple:

vector coefs = eq_name.@coefs

where eq_name is the name of your equation/regression.

TheRocK
Posts: 20
Joined: Sun Jan 18, 2009 4:18 am

Re: Testing Capital Asset Pricing Model (CAPM)

Postby TheRocK » Mon Apr 27, 2009 11:30 pm

Hi !

I have a question which is very similar in nature. I have 230 cross-sections and 10 time periods and therefore an (unbalanced) panel. For each time period, I need to calculate the beta from a single-index CAPM in the form of a time series regression:

Ri - Rf = ai + Bi (Rm - Rf)

Using annual data. This regression will give me the beta of for example company 10 in year 1 which I can then plug into my panel regression.

As you can imagine, this takes ages as I have to run the time series regression 10 times for each of the 230 cross-sections. My question is if there is any shortcut to this, maybe a loop function or anything which calculates and stores the annual beta's for me.

All the best and thanks

Kai

shliman
Posts: 1
Joined: Fri Mar 12, 2010 9:07 am

Capital Asset Pricing Model (CAPM)

Postby shliman » Fri Mar 12, 2010 9:46 am

Hi there,

I am pretty new to Eviews and I have a problem.
I have data for 495 companies and 3 indices from 01/01/2001 to 31/12/2008. I am trying to run the CAPM model for each of these companies and indices and save the Beta coefficients and standard errors into a matrix.
Since there are a lot of companies, I would like to do this in a "for loop" but I really have no idea how.
Can anyone help please?

Simon

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

Re: Testing Capital Asset Pricing Model (CAPM)

Postby EViews Gareth » Fri Mar 12, 2010 10:01 am



Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests