Hi!
I am creating a program that generate a large amount of equation using variables C (constant) X1 X2 X3 X4 X5 and dependent variable IMPORTS.
The program generates equation using all variables or only few of them. C is present in all equations.
What I wish to do is keep track of how many times the coefficient of each variables is negative. So I created a vector to count if a coefficient is negative. In order to make sure the program is counting for the right variable, I need to extract the name of the coefficient from the equations (thus identify if the coefficient of X1 or X4 is negative).
Given an equation with varlist: IMPORTS C X1 X4 X5 and knowing that coefficient C(3) is negative -> this means that the coefficient of X4 is negative.
How would one go about this?
Extracting variable name from Equation output
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: Extracting variable name from Equation output
Use the @word function to extract the ith element from the varlist, where i is the index corresponding to a negative coefficient.
Re: Extracting variable name from Equation output
I did that and I wanted to use @right in order to extract the number 2 from X2, but it does not work because @word returns a string list and @right has a string as an input.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Extracting variable name from Equation output
@word returns a string. You can feed it in to @right just fine.
Who is online
Users browsing this forum: No registered users and 2 guests
