Hello all,
How do you programmatically search within a series' object data member and alter it, and also make a group of the variables that match? For instance, let's say I have data from FRED that is nonseasonally adjusted. I wish to look within the description, find variables that are "nonseasonally adjusted", change them to "seasonally adjusted", and then make a group of the variables whose descriptions I've changed. Is this possible?
Thank you in advance for your response.
Object Data Members
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Object Data Members
Your wording makes this hard to follow, but I think what you're asking about is the label information on a series, not the data members.
You can use data members to retrieve some of the label information (@name, @type, @description, @remarks etc... - check the object reference for them all). You can also set some of the label information using procs (.label, .name, .displayname)
You can use data members to retrieve some of the label information (@name, @type, @description, @remarks etc... - check the object reference for them all). You can also set some of the label information using procs (.label, .name, .displayname)
Re: Object Data Members
Gareth,
Sorry about the wording. I'm a newbie to EViews programming. You're right. I was talking about setting label information by changing existing labels. Is that possible? Perhaps using the @replace command. For instance, I wish to loop through a set of variables that are not seasonally adjusted, seasonally adjust the variable, and then change the description so that "nonseasonally adjusted" becomes "seasonally adjusted". I've done something similar in FAME, but I'm moving away from that program, as EViews 7 has enhanced string functionality. Any help is appreciated. Below is a sample of the program I'm using, and needless to say it isn't working.
For %y cons leh govt
{%y}.label(d) @replace({%y}.@description, "nonseasonally adjusted", "seasonally adjusted")
next
Sorry about the wording. I'm a newbie to EViews programming. You're right. I was talking about setting label information by changing existing labels. Is that possible? Perhaps using the @replace command. For instance, I wish to loop through a set of variables that are not seasonally adjusted, seasonally adjust the variable, and then change the description so that "nonseasonally adjusted" becomes "seasonally adjusted". I've done something similar in FAME, but I'm moving away from that program, as EViews 7 has enhanced string functionality. Any help is appreciated. Below is a sample of the program I'm using, and needless to say it isn't working.
For %y cons leh govt
{%y}.label(d) @replace({%y}.@description, "nonseasonally adjusted", "seasonally adjusted")
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Object Data Members
No, you can set them simply with something along the lines of:
which sets the description field of X into the description field of Y
Code: Select all
%desc = x.@description
y.label(d) {%desc}
Who is online
Users browsing this forum: No registered users and 2 guests
