Code: Select all
wfcreate u 1
series a1 = nrnd
series a2 = nrnd
series a3 = nrnd
series a4 = nrnd
!totalnumber= 4 'number of series to be combined - N - see note below
for !i = 1 to !totalnumber
group group_{!i} a{!i}
for !j = 1 to !totalnumber
group group_{!i}_{!j} group_{!i} a{!j}
for !k = 1 to !totalnumber
group group_{!i}_{!j}_{!k} group_{!i}_{!j} a{!k}
for !z = 1 to !totalnumber
group group_{!i}_{!j}_{!k}_{!z} group_{!i}_{!j}_{!k} a{!z}
next
next
next
next
2.) Is there a way to generalize the code so it is independent of the 'totalnumber', other than the replacement variable in the pre-amble?
3.) Importantly, I am unable to think of a way to name/rename the groups in a consistent manner. Ideally, I would really like them to be ordered something like group_1, group_2, group_3,.... group_{N(!)/(k(!)(N-k)(!))} or similar. I tried to freeze each group in the hope that EViews might output something like table01 table02 table03 which could be renamed appropriately, but to no avail
Any inspiration or ideas on any of the above would be hugely appreciated, as always! I am pretty sure 1.) can be accomplished somehow with if's, and I think the whole thing can be done in two for loops? But I cannot quite figure out how...
Charlie
