loop using sstats
Posted: Sun Nov 04, 2012 1:42 pm
Dear Tom,
I have a couple of series where I stored teststatistics over a rolling window. I do want to compute the share of entries where the value is below 0.1.
I would like to loop over series claw1uipuk to claw24uipuk and store the computed share in the vector vcw. The sstats command for a single series works well, but if I substitute the name
of the series by the loop index "s" it's not working anymore. Whats the error? By the way how do I know which series are inside the loop index. How does rats exactly know over which series to loop?
Is it also possible to loop overseries, where more then one element changes? For example dofor s= claw1uipuk to claw24tayuk, where uip also changes to tay.
compute count = 1
dofor s = claw1uipuk to claw24uipuk
sstats(mean) 2007:01 2011:12 1 (s<0.1)>> vcw(count)
compute count=count+1
end dofor
write vcw
Thanks a lot !
I have a couple of series where I stored teststatistics over a rolling window. I do want to compute the share of entries where the value is below 0.1.
I would like to loop over series claw1uipuk to claw24uipuk and store the computed share in the vector vcw. The sstats command for a single series works well, but if I substitute the name
of the series by the loop index "s" it's not working anymore. Whats the error? By the way how do I know which series are inside the loop index. How does rats exactly know over which series to loop?
Is it also possible to loop overseries, where more then one element changes? For example dofor s= claw1uipuk to claw24tayuk, where uip also changes to tay.
compute count = 1
dofor s = claw1uipuk to claw24uipuk
sstats(mean) 2007:01 2011:12 1 (s<0.1)>> vcw(count)
compute count=count+1
end dofor
write vcw
Thanks a lot !