Hello All,
I am trying to write a programme in EViews which will automate the procedure to detect, then remove, the presence of serial correlation in a time series. Specifically, I need to automate the following tasks:
1. The user enters a table of data, with each column containing a different time series. EViews creates a new, blank table called 'new'. Call the table entered by the user 'old'.
2. For each time series entered by the user in the 'old' table, Eviews automatically runs View -> Correlogram -> Levels (with 6 lags) -> OK.
3. If the first 'prob' value in the last column is more than 0.05, go to step 4. Otherwise, go to step 5.
4. 'prob' is more than 0.05. Copy the whole time series except the first datapoint into the corresponding column in the 'new' table.
5. 'prob' is less than 0.05. Suppose the series is called x.
(i) Select two series in the workfile, Open As Equation, and type:
x x(-1) c
(ii) Copy the coefficient for x(-1), and assign it to a new variable called b.
(iii) In the command line, type: x_us = (x-b*x(-1))/(1-b)
where x is still the name of the series.
(iv) Open the new series, x_us, and view the correlogram as in step 2. In most cases, the 'prob' value will now be more than 0.05.
(v) Copy and paste the x_us series into the correct column in the 'new' table.
As I have never written a programme in EViews before, I am trying to understand how to write this. In particular, how do you "read" a correlogram from each series in an input? Is there a way of seeing automatically whether the p value is less than 0.05?
I would be very grateful for any suggestions.
Automation of tasks
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Automation of tasks
With regards to the correlogram question, the easiest way to do it is to freeze the correlogram into a table, and then grab the p-value from that table.
Something like:
As a general response to your post, you're probably best off reading through some of the existing programs, including the introduction to EViews programming, in this forum, to ensure you're familiar with the way programming is done within EViews.
Something like:
Code: Select all
freeze(mytable) x.correl(6)
!pval = mytable(7,7)
Who is online
Users browsing this forum: No registered users and 2 guests
