Hallo, I've a question concerning the creation of a sample. I'm doing an event study about stockprices and I have currently 50 stocks but much more events as per stock more events occured hence 930 events. I would like to create a sample now for my eventwindow. But when I run the programm there always occurs an error because the events do not have different names (since always appr. 10 events have the same name, the name of the stock), so does anyone know how to either give them different names or program a command so that it recognizes this?
thanks very much in advance
More Event Dates per Stock
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: More Event Dates per Stock
I'm afraid I cannot understand your question at all.
-
carolin_5340
- Posts: 4
- Joined: Mon Apr 28, 2014 3:44 am
Re: More Event Dates per Stock
Ok so I try it again ;-) ... Just right now I'm trying to do an event study, this event study is about the stock price effect. I have about 50 companies hence 50 stocks, but much more events since companies do have more than one event during the observation time. So when I was doing the program I started to create series, I got 50 series and than I wanted to do a regression with a new sample, the sample should include all my events so that I can do the regression for the event window. My question is how I can ensure within my program, that although I have just 50 series Í can generate a sample with about 900 events?
thanks very much
thanks very much
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: More Event Dates per Stock
Still not clear.
What does the number of series have to do with how many observations are in the sample?
What does the number of series have to do with how many observations are in the sample?
-
carolin_5340
- Posts: 4
- Joined: Mon Apr 28, 2014 3:44 am
Re: More Event Dates per Stock
it comes to a problem, due to the fact that I have more than one observation (event) per series, because when I want to make a sample (eg -200 - -100 days to the eventdate) an error window pops up. I guess due to the reason that I have an error in my program and that it is not possible to name the different samples (900 like number of observations or events) like their original series they belong to because than more than one sample would have the same name. So maybe you can tell me how to write the command, so that I can call my new generated samples differently than the series it gets the event from?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: More Event Dates per Stock
Sorry, I am completely lost, and have no idea what you are describing or what you want to do.
Perhaps you can provide a concrete example with actual data?
Perhaps you can provide a concrete example with actual data?
-
carolin_5340
- Posts: 4
- Joined: Mon Apr 28, 2014 3:44 am
Re: More Event Dates per Stock
or !i = 1 to 50
smpl @all
'store the series name in %name
%name = results(1,!i+1)
'rename stock price series
'rename %name p_!i
'create return series
series r_!i =dlog(p_!i)
'dummy variable
'delete ed_!i
series ed_{%name} = 0
'rename ed_{%name} ed_!i
next
for !j = 1 to 924
'read the date from the table ('define announcement date variable)
%evdate = eventdates(!j+1,2)
smpl %evdate %evdate
'stores the series name in %name
%name = eventdates(!j+1,1)
'dummy variable
ed_{%name} = 1
'define new sample for market-model-regression
delete s_!j
sample s_!j %evdate-10 %evdate-5
smpl s_!j
'regression
equation eq_{!j}.ls r_!i c r_dowj 'dowj = index
'plot alpha and beta in results table
'results(2,1+!i) = c(1)
'results(3,1+!i) = c(2)
next
This is my program so far...
and my problem is that I do not know how I can get 925 regression equations since i just have 50 r_!i but I need 925 regressions as I have 925 events. It is for example that r_1 has 5 events. So it would be optimal if I could get a command which shows me how I can assign e.g. 5 events to one series. So that as a consequene I can have 925 eq_!i or eq_!j and e.g. eq_1 - eq_5 are all dependent on r_1 but eq_6 - eq_8 are dependent on r_2 and so on?
thank you very much
smpl @all
'store the series name in %name
%name = results(1,!i+1)
'rename stock price series
'rename %name p_!i
'create return series
series r_!i =dlog(p_!i)
'dummy variable
'delete ed_!i
series ed_{%name} = 0
'rename ed_{%name} ed_!i
next
for !j = 1 to 924
'read the date from the table ('define announcement date variable)
%evdate = eventdates(!j+1,2)
smpl %evdate %evdate
'stores the series name in %name
%name = eventdates(!j+1,1)
'dummy variable
ed_{%name} = 1
'define new sample for market-model-regression
delete s_!j
sample s_!j %evdate-10 %evdate-5
smpl s_!j
'regression
equation eq_{!j}.ls r_!i c r_dowj 'dowj = index
'plot alpha and beta in results table
'results(2,1+!i) = c(1)
'results(3,1+!i) = c(2)
next
This is my program so far...
and my problem is that I do not know how I can get 925 regression equations since i just have 50 r_!i but I need 925 regressions as I have 925 events. It is for example that r_1 has 5 events. So it would be optimal if I could get a command which shows me how I can assign e.g. 5 events to one series. So that as a consequene I can have 925 eq_!i or eq_!j and e.g. eq_1 - eq_5 are all dependent on r_1 but eq_6 - eq_8 are dependent on r_2 and so on?
thank you very much
Who is online
Users browsing this forum: No registered users and 2 guests
