# HG changeset patch # User Jaroslav Hajek # Date 1228718855 -3600 # Node ID af0adfbd3d167ee4e5ec9a1255df1b1bc299c088 # Parent 4ccdb0d32158b0458fa98c8ac3d021f935b95bf8 workaround missing roundb diff -r 4ccdb0d32158 -r af0adfbd3d16 scripts/statistics/base/__quantile__.m --- a/scripts/statistics/base/__quantile__.m Mon Dec 08 07:30:58 2008 +0100 +++ b/scripts/statistics/base/__quantile__.m Mon Dec 08 07:47:35 2008 +0100 @@ -87,7 +87,12 @@ ## Used by SAS, method PCTLDEF=2. ## http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/stdize_sect14.htm t = max (kron (p, m), 1); - t = roundb (t); + # t = roundb (t); + # roundb unsupported in 3.0.x, so supply a hack + t1 = round (t); + t1m = (abs (t - t1) == 0.5) & (mod (t1, 2) == 1); + t1 (t1m) += 2 * (t-t1)(t1m); + t = t1; inv(k,:) = x(t + pcd); endswitch