Page 1 of 1

What's efficient way

Posted: Tue May 24, 2016 10:39 pm
by Chthoniid
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

Re: What's efficient way

Posted: Wed May 25, 2016 1:09 am
by EViews Gareth
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.

Re: What's efficient way

Posted: Wed May 25, 2016 2:12 am
by Chthoniid
What structure do your data have?

It might be that something like:

Code: Select all

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