Hi there,
I was hoping for some help.
I have a large number of monthly time series, for which I've been trying to work out how to extract a count of the observations that sit within a given range for each month. To be more specific, they're all monthly percent changes in the various sub-components of the headline consumer price index and I wanted to count, for example, how many of those sit within the range +1% MoM to +1.5% MoM.
I thought I might be able to do it using @obsby but haven't had any success.
Any thoughts?
Thanks
Count of observations falling within a range
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13315
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Count of observations falling within a range
Code: Select all
smpl if cpig>0.01 and cpig<0.015
scalar num = @obssmpl
Follow us on Twitter @IHSEViews
Re: Count of observations falling within a range
Thanks for your reply, Gareth, but it hasn't done the trick.
I'm getting an error that '@OBSSMP is an illegal or reserved name in "SCALAR NUM = @OBSSMP" ' (I'm using Eviews 11).
Also (and, sorry, perhaps I wasn't clear enough in my original post), I want to return the number of observations within that range for each month, so the output is a timeseries rather than a scalar value.
Thanks for your help.
I'm getting an error that '@OBSSMP is an illegal or reserved name in "SCALAR NUM = @OBSSMP" ' (I'm using Eviews 11).
Also (and, sorry, perhaps I wasn't clear enough in my original post), I want to return the number of observations within that range for each month, so the output is a timeseries rather than a scalar value.
Thanks for your help.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13315
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Count of observations falling within a range
Code: Select all
alpha yearmonth = @datestr(@date, "YYYYMM")
smpl if cpig>0.01 and cpig<0.015
series num = @obsby(cpig, yearmonth)
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 19 guests