Importing data from excel, large amount of NA

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

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

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Importing data from excel, large amount of NA

Postby EViews Glenn » Tue Aug 07, 2012 8:42 pm

Some cross-sections have different available periods/dates.

martingale
Posts: 51
Joined: Tue Jul 24, 2012 11:36 am

Re: Importing data from excel, large amount of NA

Postby martingale » Wed Aug 08, 2012 1:48 am

Thanx!

The data set I imported from Excel consists of columns with dates, various financial variables, company names, the companies ticket codes and a column with the companies "identifier" codes used in the database the data comes from.

It seems that to each date corresponds either 1 or 0 observation for each company. For company A there might be 90 observations out of 100 dates and for company B there might be 80 observations. So the number of observations for each company is unequal. I guess this is what is meant with "unbalanced".

Questions:

Is every company one cross section? (I have several hundred companies in the data set)

How can I restructure the data so that I can create time series of the financial variables for each company of equal length?

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Importing data from excel, large amount of NA

Postby EViews Glenn » Wed Aug 08, 2012 9:48 am

Sounds like it.

Not sure why you want to balance, but if you do, click on Proc/Structure-Resize Current Page from the workfile window, then make sure the boxes Balance between starts & ends, Balance starts, Balance ends are all checked. Click on OK.

martingale
Posts: 51
Joined: Tue Jul 24, 2012 11:36 am

Re: Importing data from excel, large amount of NA

Postby martingale » Wed Aug 08, 2012 10:52 am

Companies were stacked in Excel in a single column and are stacked the same way in a single series in EViews. The current structure in Eviews doesn't seem to recognize the companies as cross sections. Is it possible to decompose these single series to cross sections, one cross section for each company?

To put it another way:
Now I have a single series in EViews called "un. returns", a single series with the companies caled "ticker" and a single series with the dates called "period YYYTMMDD" which seems to be read by EViews as characters instead of dates.

What I want is:
To restructure the data so that each company has its own series, one for dates and one for returns.

How can this be done?

(PS: I read somewhere in the forum that tests between two series cannot be run if the series are of unequal length)
Last edited by martingale on Wed Aug 08, 2012 11:16 am, edited 2 times in total.

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

Re: Importing data from excel, large amount of NA

Postby EViews Gareth » Wed Aug 08, 2012 10:57 am

Proc->Reshape Current Page->Unstack in New Page.

Enter "ticker" in the first box, and "period" in the second.

martingale
Posts: 51
Joined: Tue Jul 24, 2012 11:36 am

Re: Importing data from excel, large amount of NA

Postby martingale » Wed Aug 08, 2012 12:11 pm

thanx, when I do the above I get the error message: "illegal panel structure dateid is nested within the previous dimensions of the panel structure"

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

Re: Importing data from excel, large amount of NA

Postby EViews Gareth » Wed Aug 08, 2012 1:34 pm

You have a single value for date.

martingale
Posts: 51
Joined: Tue Jul 24, 2012 11:36 am

Re: Importing data from excel, large amount of NA

Postby martingale » Wed Aug 08, 2012 3:14 pm

In the sample of the 100 first observations yes, it is the same date X 100 but in the original dataset of 271000 observations there are different dates, so ok, this is resolved in the original dataset.

I get another error message in the original dataset when I try unstacking:

"One or more of the series names produced by unstacking are too long"

Then the unstacking process stops.

What is causing this problem and is there a way around it?

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

Re: Importing data from excel, large amount of NA

Postby EViews Gareth » Wed Aug 08, 2012 3:17 pm

One of your tickers is too long to be used as a series name when appended to your existing series names. Either reduce the size of your ticker text, or reduce the size of your current series names (or both).

martingale
Posts: 51
Joined: Tue Jul 24, 2012 11:36 am

Re: Importing data from excel, large amount of NA

Postby martingale » Wed Aug 08, 2012 3:40 pm

thanx!

jnkfoune
Posts: 14
Joined: Mon Aug 13, 2012 12:44 am

Re: Importing data from excel, large amount of NA

Postby jnkfoune » Tue Aug 14, 2012 5:14 am

Hello,

I am trying to import data (daily stock returns) from an excel file by different ways as explained in this topic:
http://forums.eviews.com/viewtopic.php?f=7&t=74

The result is that I get in the 1st column the date and for the 3 following columns I get NA (the 3 columns are numbers : weekday, stock1, stock2)

Moreover, during the importation, at step 2 of 3, I can read the value, Eviews show me the content that has to be imported, but at step 3 of 3, it doesnt display anymore the values, it just display NA instead of each value

Thank you for your help
Attachments
SPX_VIX.xls
(443 KiB) Downloaded 706 times

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: Importing data from excel, large amount of NA

Postby startz » Tue Aug 14, 2012 6:10 am

The file loads fine. Some of your early values are NA and that's wbat you're seeing.

jnkfoune
Posts: 14
Joined: Mon Aug 13, 2012 12:44 am

Re: Importing data from excel, large amount of NA

Postby jnkfoune » Tue Aug 14, 2012 6:26 am

Actually no, all the columns and values load NA except the date column) I also tried with another file containing just one column for date, one for weekday and one for the stock return and I have the same problem.

I also tried from my 1st file to load starting after the 1st value NA (of the VIX column) and it doesnt work either...

Well while writing this post I decided to try one more time, and it worked, it is very weird, but nevermind this is now working, thank you for trying on your side!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests