I am trying to create an event study, the total sample has 30 years of daily data for 30 companies, and I want run a regression for each day, therefore, each day would be a new small sample...
My code lines are:
!n = 0
for !i = 1 to 30
!n = !n + @sum(d_!i)
next
!l1 = 250
!l2 = 21
matrix(!l2,!n) car
vector(!n) var_err
!n1 = 0
for !i = 1 to 30
for !t = 1 to @obs(date)
if d_!i(!t) = 1 and r_!i(!t) = 1 then
!n1 = !n1 +1
!sd = !t-!l1-(!l2-1)/2
!ed = !t-(!l2-1)/2-1
smpl !sd !ed
!avg = @mean(s_!i)
series err = s_!i - !avg
var_err(!n1) = !l2*@vars(err)
!sd = !t-(!l2-1)/2
!ed = !t+(!l2-1)/2
smpl !sd !ed
series abnr = s_!i - !avg
series cum_ar = abnr
for !j = !t-(!l2-1)/2+1 to !t+(!l2-1)/2
cum_ar(!j) = cum_ar(!j-1) + abnr(!j)
next
vector aux = @convert(cum_ar)
colplace(car,aux,!n1)
smpl @all
delete abnr cum_ar aux err
endif
next
next
The code of errors are:
Error in Sample: Illegal date in "SMPL -26 223".
Error in Sample: Illegal date in "SMPL -106 143".
Error in Sample: Illegal date in "SMPL -171 78".
Error in Sample: Illegal date in "SMPL -27 222".
7315 is not a valid index for vector-series-coefficient ABNR in "CUM_AR(7315) = CUM_AR(7315-1) + ABNR(7315)".
7316 is not a valid index for vector-series-coefficient ABNR in "CUM_AR(7316) = CUM_AR(7316-1) + ABNR(7316)".
7317 is not a valid index for vector-series-coefficient ABNR in "CUM_AR(7317) = CUM_AR(7317-1) + ABNR(7317)".
Matrix size mismatch in "COLPLACE(CAR,AUX,145)".
Error in Sample: Illegal date in "SMPL -82 167".
how do I fix this?
Thanks in Advance
Error
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Error
At a guess, you're calculating !sd incorrectly.
Who is online
Users browsing this forum: No registered users and 2 guests
