Importing lables from ascii or excel files

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

yoniboi
Posts: 16
Joined: Mon Oct 12, 2009 5:26 am

Importing lables from ascii or excel files

Postby yoniboi » Mon Oct 12, 2009 5:39 am

how do i import along with the variables (for example v1 to v121) lables that i have made in excel or a csv file.

an example of it would be v1 has a label of gdp and v2 has a label of cpi

(i dont want to write manually 121 labels)

i am using v1-v121 because they will be used later in programs that i am writing and i want the grapical repsentation to have the labels of the variables and not v1-v121.

thanks

yoniboi

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

Re: Importing lables from ascii or excel files

Postby EViews Gareth » Mon Oct 12, 2009 7:59 am

Assuming you have the name in the first row, and the label in the second row, when you open the Excel file in EViews, on the second page of the Excel read dialog there is a section that lets you specify the header rows. Change this so that is says there are two rows of headers, and the name is in the first row. EViews will then read the second row as a description.
Follow us on Twitter @IHSEViews

yoniboi
Posts: 16
Joined: Mon Oct 12, 2009 5:26 am

Re: Importing lables from ascii or excel files

Postby yoniboi » Mon Oct 12, 2009 9:54 am

Thank you for the quick response, but what i need is for the second feild to go into the label not the description, so when i make graphs and such the label will show up and not the generic variable name i give it.

thank you

yoniboi

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

Re: Importing lables from ascii or excel files

Postby EViews Gareth » Mon Oct 12, 2009 10:15 am

I think you're confusing "display name" and "label", but I understand what you mean. There is no way to import the description as a display name.

If you're using EViews 7, you can do something along the lines of:

Code: Select all

%s = x.@description
x.displayname {%s}


where X is the name of a series. Obviously if you have lots of series, you could write a for loop to loop through them all doing the same thing.
Follow us on Twitter @IHSEViews

yoniboi
Posts: 16
Joined: Mon Oct 12, 2009 5:26 am

Re: Importing lables from ascii or excel files

Postby yoniboi » Mon Oct 12, 2009 10:29 am

I cannot use the same code for Eviews 6 or a variation of it?

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

Re: Importing lables from ascii or excel files

Postby EViews Gareth » Mon Oct 12, 2009 10:39 am

Code: Select all

freeze(t) x.label
%s = t(6,2)
d t
w1.displayname {%s}
Follow us on Twitter @IHSEViews

yoniboi
Posts: 16
Joined: Mon Oct 12, 2009 5:26 am

Re: Importing lables from ascii or excel files

Postby yoniboi » Mon Oct 12, 2009 12:22 pm

that code worked great thanks


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 23 guests