Page 1 of 1

Rounding a scalar to the nearest whole number (eviews 7)

Posted: Thu Feb 23, 2012 8:58 am
by mike_d
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

Re: Rounding a scalar to the nearest whole number (eviews 7)

Posted: Thu Feb 23, 2012 9:00 am
by EViews Gareth

Code: Select all

c!g = @round(c!g)

Re: Rounding a scalar to the nearest whole number (eviews 7)

Posted: Thu Feb 23, 2012 9:03 am
by mike_d
Thank you Gareth!