Page 1 of 1
Programming a group that is observation dependent?
Posted: Fri Jul 02, 2021 3:57 pm
by miorinnovo
Is it possible to create a group that is dependent on certain characteristics of the time series? For example, say I have 100 series, but I just want to take the 10 series with the highest value in the observation of its time series.
Thanks!
Re: Programming a group that is observation dependent?
Posted: Fri Jul 02, 2021 9:11 pm
by EViews Gareth
Not really.
For some statistics, you could put the 100 into a group then reorder that group (using group.reorder - documentation isn't available, but if you open the group, then click on View->Group Members, then hit the order button, you can see the command capture) by some statistic, then take the first 10 members of the reordered group and put them in a new group.
Re: Programming a group that is observation dependent?
Posted: Fri Jul 02, 2021 9:22 pm
by EViews Gareth
Code: Select all
create u 100
for !i=1 to 100
series x!i=nrnd
next
group g x*
g.reorder @mean
group bestmeans
for !i=1 to 10
bestmeans.add g(!i)
next
Re: Programming a group that is observation dependent?
Posted: Tue Jul 06, 2021 6:00 am
by miorinnovo
thanks for the work around suggestion. In eviews 11 Im getting this error: REORDER is not a valid view for G in "G.REORDER @MEAN"
on line 8.
Re: Programming a group that is observation dependent?
Posted: Tue Jul 06, 2021 8:40 am
by EViews Gareth
It was added in ev12
Re: Programming a group that is observation dependent?
Posted: Wed Jul 07, 2021 6:52 am
by miorinnovo
Thanks Gareth! I upgraded and it works!
Do you know if I could do something similar but instead of the mean I order by say the value for January 2020?
Edit: Sorry you said we cant do this, but we can order by the last observation... so I can use that and changing the sample. thanks!