Rounding a scalar to the nearest whole number (eviews 7)
Posted: Thu Feb 23, 2012 8:58 am
Hi,
I have a loop that fills a vector with scalar values from a pre-estimated table (5 values in total). Then what I would like to do is to take an average of these 5 values to use in a formula later on. However the formula requires that the inputted value be a whole number. Therefore I would like the scalar to be rounded to the nearest whole number. I will post what I have below, but I have not been able to find a method rounding. Any suggestions are greatly appreciated.
for !g = 9 to 14
scalar c!g
vector(5) cc!g
for !h = 1 to 5
cc!g(!h) = @val(coint_test!g(13,!h+1))
next !h
scalar c!g = @mean(cc!g)
next !g
I have a loop that fills a vector with scalar values from a pre-estimated table (5 values in total). Then what I would like to do is to take an average of these 5 values to use in a formula later on. However the formula requires that the inputted value be a whole number. Therefore I would like the scalar to be rounded to the nearest whole number. I will post what I have below, but I have not been able to find a method rounding. Any suggestions are greatly appreciated.
for !g = 9 to 14
scalar c!g
vector(5) cc!g
for !h = 1 to 5
cc!g(!h) = @val(coint_test!g(13,!h+1))
next !h
scalar c!g = @mean(cc!g)
next !g