average number of days

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

average number of days

Postby miorinnovo » Tue Jun 16, 2015 10:43 am

Is there a way to program an automatic adjustment in a series so that a series gets divided by the number of days in a month? I would want the raw data to be automatically divided by 31 for all Januaries, 28 pr 29 for Februaries, etc.

Thanks!

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

Re: average number of days

Postby EViews Gareth » Tue Jun 16, 2015 10:48 am

What's the frequency of the workfile?

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: average number of days

Postby miorinnovo » Tue Jun 16, 2015 10:50 am

Monthly. The data series is monthly, I'd just prefer average per day in that month.

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

Re: average number of days

Postby EViews Gareth » Tue Jun 16, 2015 10:51 am

Code: Select all

series av_x = x/@daycount

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: average number of days

Postby miorinnovo » Tue Jun 16, 2015 12:37 pm

I replaced the x in your example with my series name and I get the message:

Numeric operator applied to string data.

Any idea why?

Edit: Actually nevermind, I got it to work by doing 2 steps, creating a series called days using @daycount then dividing by that series.

Thanks Gareth


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest