On Viernes, 18 de Septiembre de 2009 09:45:56 Kehl Dániel escribió:
Dear Community,
I want to generate x random numbers and compute some descripive statistics
on the results. Than I round the values of the random numbers and want to
know, how my desriptive statistics have changed. I want to make this
process n times. I have two questions. 1. Is there a way to set the
roundings Base, I mean to the nearest 0,1 or 10. Not just integers but
other rounding rules I mean.
Some examples for solving the first question:
? scalar a=9.1245
Se ha generado el escalar a = 9,1245
? scalar b0 = round(a)
Se ha generado el escalar b0 = 9
? scalar b01 = round(10*a)/10
Se ha generado el escalar b01 = 9,1
? scalar b001 = round(100*a)/100
Se ha generado el escalar b001 = 9,12
? scalar b10 = round(0.1*a)/0.1
Se ha generado el escalar b10 = 10
?
--
Ignacio Diaz-Emparanza
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.et.bs.ehu.es