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
Rounding a scalar to the nearest whole number (eviews 7)
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rounding a scalar to the nearest whole number (eviews 7)
Code: Select all
c!g = @round(c!g)
Re: Rounding a scalar to the nearest whole number (eviews 7)
Thank you Gareth!
Who is online
Users browsing this forum: No registered users and 2 guests
