defining multiple groups in nested loop with equality tests
Posted: Tue Jul 01, 2014 7:09 am
Hello I am new to the forum and completely new to Eviews programming. I have two series of data (call them series1 and series2) as well as a series specifying a year (year) and a series specifying an industry (industry). For each year and each industry, I would like to perform an equality test between the median of that specific set of series1 and series2 (10 years times 9 industries = 90 sets). It seems that what I need to do is create a nested for loop that creates two new series for each of these sets, creates a group, and proceeds to run and record an equality test. So something like this (using pseudo-code):
For i = 2004 through 2013
For j = 1 through 10 (referring to the industry)
newseries1 = series1 if year = i AND industry = j
newseries2 = series2 if year = i AND industry = j
newgroup = newseries1 and newseries2
run equality test for medians between newseries1 and newseries2 in newgroup (testbtw function)
record full results of median equality test
End For
End For
.
I can easily assign a number 1 through 90 to each "industry year" if that is simpler than creating a nested for loop. Any comments would be greatly appreciated. Thank you
**EDIT: I should add that I am using Eviews 8**
For i = 2004 through 2013
For j = 1 through 10 (referring to the industry)
newseries1 = series1 if year = i AND industry = j
newseries2 = series2 if year = i AND industry = j
newgroup = newseries1 and newseries2
run equality test for medians between newseries1 and newseries2 in newgroup (testbtw function)
record full results of median equality test
End For
End For
.
I can easily assign a number 1 through 90 to each "industry year" if that is simpler than creating a nested for loop. Any comments would be greatly appreciated. Thank you
**EDIT: I should add that I am using Eviews 8**