Question concerning programming and t-statistics

For questions regarding programming in the EViews programming language.

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

jona
Posts: 1
Joined: Wed Sep 26, 2012 5:59 am

Question concerning programming and t-statistics

Postby jona » Wed Sep 26, 2012 6:09 am

Hello,

I´m writing a paper on the effects sovereign ratings have on government bonds. For this I´m preforming an event study in Eviews, I have written a program and got out the abnormal and cummulative abnormal returns for my event sample (being the day before, the day of nd the day after the rating changes). Now i would just need to check them for statistical significance and this is where I´m stuck. I have added my program below and was hoping someone would have any tips concerning the generation of the correct t-statistics for me.

Thanks in advance,
Jona



!k = 2 'counting variable for event date table
!d = 0 'counting variable for number of events
series ret_eur_yield = dlog(eur_yield)

for !i = 1 to 9 'loop for each stock

smpl @all 'setting sample

%share = output(!i+1,1)
%ret_share = "ret_" + %share
series {%ret_share} = dlog({%share})

output(!i+1,2) = @mean({%ret_share})
output(!i+1,3) = @stdevs({%ret_share})

for !z= 1 to 1000


%edate = events(!k,1)

sm_estimation.set %edate-100 %edate-1
smpl sm_estimation


equation market_model.ls {%ret_share} c ret_eur_yield {%ret_share}(-1) {%ret_share}(-2) {%ret_share}(-3)
vector pval = @tdist(market_model.@tstats,market_model.@regobs-market_model.@ncoefs)
!alag = 3

if pval(5) > 0.05 then

equation market_model.ls {%ret_share} c ret_eur_yield {%ret_share}(-1) {%ret_share}(-2)
vector pval = @tdist(market_model.@tstats,market_model.@regobs-market_model.@ncoefs)
!alag = 2

if pval(4) > 0.05 then

equation market_model.ls {%ret_share} c ret_eur_yield {%ret_share}(-1)
vector pval = @tdist(market_model.@tstats,market_model.@regobs-market_model.@ncoefs)
!alag = 1

if pval(3) > 0.05 then

equation market_model.ls {%ret_share} c ret_eur_yield
vector pval = @tdist(market_model.@tstats,market_model.@regobs-market_model.@ncoefs)
!alag = 0

endif

endif

endif


sm_event.set %edate-1 %edate+1
smpl sm_event



%ser_f = "ser_f_" + %share + "_" + @str(!d)
%ser_ab = "ret_ab_" + %share + "_" + @str(!d)
%ser_cuab = "ret_cuab_" + %share + "_" + @str(!d)



market_model.forecast(f=na) {%ser_f} 'forecast returns based on defined market model


series {%ser_ab} = {%ret_share} - {%ser_f}

series {%ser_cuab} = @cumsum({%ser_ab},sm_event)

!k = !k + 1
!d = !d + 1



if output(!i+2,1) = events(!k,1) then

!k = !k + 1
!d = 0
!z = 1000

endif

if events(!k,1) = 1 then
smpl @all
stop

endif


next

next

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

Re: Question concerning programming and t-statistics

Postby EViews Gareth » Wed Sep 26, 2012 7:48 am

You're going to have to be a lot more specific in order to get any help, I think.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests