What's efficient way

For questions regarding programming in the EViews programming language.

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

Chthoniid
Posts: 24
Joined: Mon Oct 22, 2012 6:02 pm

What's efficient way

Postby Chthoniid » Tue May 24, 2016 10:39 pm

I'm still a novice when it comes to programming, and have a problem.

I've got a large data set, based on roughly 20,000 hunters and 15 years.

What I want is the minimum length of each alligator for each hunter, for each year.
The current code is

for !year = 2000 to 2014
smpl if harvestyear=!year
for !hunter= 1 to 21534
smpl if hunter_ser=!hunter
series min_hide=@min(length)
next
next

The problem (obviously) is that this gives the minimum length for each hunter over the entire 15 year period. I'm looking for an elegant and efficient way to break it down further, into the minimum length per hunter per year.

TIA for any ideas.

B

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

Re: What's efficient way

Postby EViews Gareth » Wed May 25, 2016 1:09 am

What structure do your data have?

It might be that something like:

Code: Select all

for !year = 2000 to 2014 smpl if harvestyear=!year series min_hide = @minsby(length, hunter_ser) next
will work.

Chthoniid
Posts: 24
Joined: Mon Oct 22, 2012 6:02 pm

Re: What's efficient way

Postby Chthoniid » Wed May 25, 2016 2:12 am

What structure do your data have?

It might be that something like:

Code: Select all

... will work.[/quote] Brilliant, works perfectly. Thanks


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests