[R] npmc problem?
Etsushi Kato
ekato at ees.hokudai.ac.jp
Mon Apr 26 10:14:00 CEST 2004
Hi,
I recently tried to conduct non-parametric multiple comparison with
npmc package, and encountered some problem; sometimes it stopped with
following error.
Error in uniroot(f = function(arg) p - z.dist(arg, corr = corr, df =
df, :
f() values at end points not of opposite sign
Although I'm not quite sure about calculation of z.quaintile in npmc.R,
it seems increment of upper (or decrement of lower) is not sufficient
since the z.dist() value is not repeatable (randomized values) resulted
from mvtnorm, and sometimes failed to do uniroot().
For my case, I can avoid the error with changing upper and lower with
adding or subtracting 2 for uniroot. Is it safe to use such modified
verson of npmc?
--- npmc.orig 2004-04-26 14:13:00.000000000 +0900
+++ npmc 2004-04-26 16:50:59.000000000 +0900
@@ -131,7 +131,7 @@
lower <- lower-1;
}
ur <- uniroot(f=function(arg)
p-z.dist(arg,corr=corr,df=df,sides=sides),
- upper=upper, lower=lower
+ upper=upper+2, lower=lower-2
);
ur$root;
}
Here is the my test dataframe.
"class" "var"
"1" 1197.90816
"1" 3725.82418
"1" 1159.66667
"1" 2835.05556
"1" 2093.20000
"2" 3012.50000
"2" 1895.52381
"2" 3033.07692
"2" 1790.00000
"2" 4103.60000
"2" 1870.13636
"2" 3331.15385
"2" 2066.00000
"2" 2021.92308
"3" 2440.05000
"3" 4615.78893
"3" 2063.50000
"3" 1193.65790
"4" 1569.62500
"4" 1912.72222
"4" 4708.72727
"4" 1722.95833
"4" 2809.14286
"5" 1077.43478
"5" 193.77500
"5" 1230.23529
"5" 8180.73171
"5" 3879.00000
"5" 1050.55556
"6" 1406.72000
"6" 208.94737
"6" 1276.68421
"6" 639.85714
"6" 793.73684
"6" 1043.83871
"8" 647.55000
"8" 97.81000
"8" 208.67308
"8" 765.85000
"8" 2803.00000
"8" 543.71429
"8" 120.16000
"8" 5757.25000
"8" 5211.62500
"9" 3675.00000
"9" 479.09508
"9" 2620.70707
"9" 3095.75000
"9" 633.16250
"10" 2397.03390
"10" 524.37625
"10" 2693.09524
"10" 796.36250
"10" 2261.87500
"10" 1122.01250
"11" 1543.10000
"11" 2127.04545
"11" 1692.87500
"12" 2752.75000
"12" 385.43750
"12" 4576.50000
"12" 7006.12500
"12" 2779.87500
"12" 2704.25000
"13" 3715.25000
"13" 3447.87500
"13" 509.60000
"13" 3238.62500
"13" 674.06250
"13" 4329.62500
"13" 5593.50000
"14" 2666.87500
"14" 1636.37500
"14" 195.76250
"14" 687.06250
"14" 2175.50000
"14" 1385.87500
"15" 571.41250
"15" 2457.89812
"15" 4110.75935
"16" 3279.87500
"16" 2788.50000
"16" 641.95000
"16" 431.38280
"16" 1343.25000
"16" 1952.62500
"17" 2917.00000
"17" 14622.54902
"17" 5030.37500
"19" 1118.98750
"19" 609.13750
"19" 1580.37500
"19" 770.58750
"19" 53.66231
"19" 253.28750
--
Etsushi Kato
ekato at ees.hokudai.ac.jp
More information about the R-help
mailing list