Import CSV as numeric

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

BigD
Posts: 28
Joined: Wed Jan 04, 2017 7:05 am

Import CSV as numeric

Postby BigD » Tue Apr 04, 2017 7:43 am

Hi,

I have a CSV file I'd like to import. I've used the pageload command and the import command for this. But no matter what, the series are imported as alphas. Especially those that have "NA"s before numbers. When I imported it manually, the series came out as numeric. Is there a workaround for this?

I've attached my CSV file.

Here are the codes I've tried:

Code: Select all

import(page=Newdata) %myfile ftype=ascii rectype=crlf skip=0 fieldtype=delimited delim=comma byrow colhead=2 namepos=first eoltype=pad badfield=NA @freq {%frequency} @smpl @all

Code: Select all

pageload %myfile ftype=ascii rectype=crlf skip=0 fieldtype=delimited delim=comma byrow colhead=2 namepos=first eoltype=pad badfield=NA @freq {%frequency} @smpl @all

%myfile is the file path to the CSV.
{%freqeuncy} is just a variable that holds either a, q, or m. This CSV has a monthly frequency so {%frequency} becomes m.

Thanks!
Attachments
newdata.csv
(89.23 KiB) Downloaded 249 times

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

Re: Import CSV as numeric

Postby EViews Gareth » Tue Apr 04, 2017 8:49 am

Use the na="NA" argument.
Follow us on Twitter @IHSEViews

BigD
Posts: 28
Joined: Wed Jan 04, 2017 7:05 am

Re: Import CSV as numeric

Postby BigD » Tue Apr 04, 2017 9:19 am

Thank you so much. :D :D :D


Return to “Data Manipulation”

Who is online

Users browsing this forum: Google [Bot] and 18 guests