@@ -1076,180 +1076,7 @@ Sat Apr 01 07:32:27 2000 ripley moved from incoming to Add-ons
1076
1076
1077
1077
Directory: Analyses
1078
1078
1079
- * PR# 934 *
1080
- Subject: ks.test in ctest package
1081
- From: Murray Smith <
[email protected] >
1082
- Date: Tue, 08 May 2001 16:52:07 +1200
1083
- --code and documentations suggestions
1084
- ~~~~~~~~~~ original reports follow ~~~~~~~~~~
1085
- ==> 934 <==
1086
- From
[email protected] Tue May 8 06:49:45 2001
1087
- Received: from franz.stat.wisc.edu (
[email protected] [128.105.174.95])
1088
- by pubhealth.ku.dk (8.9.3/8.9.1) with ESMTP id GAA03018
1089
- for <
[email protected] >; Tue, 8 May 2001 06:49:44 +0200 (MET DST)
1090
- Received: from mailhost.auckland.ac.nz (really [130.216.1.4]) by franz.stat.wisc.edu
1091
- via smail with esmtp
1092
- id <
[email protected] > (Debian Smail3.2.0.111)
1093
- for <
[email protected] >; Mon, 7 May 2001 23:49:53 -0500 (CDT)
1094
- Received: from esu1.auckland.ac.nz (esu1.auckland.ac.nz [130.216.208.1])
1095
- by mailhost.auckland.ac.nz (8.9.2/8.9.2/8.9.2-ua) with ESMTP id QAA09961
1096
- for <@mailhost.auckland.ac.nz:
[email protected] >; Tue, 8 May 2001 16:49:48 +1200 (NZST)
1097
- Received: from auckland.ac.nz (esp60 [130.216.208.160]) by esu1.auckland.ac.nz (980427.SGI.8.8.8/980728.SGI.AUTOCF) via ESMTP id QAA70397 for <
[email protected] >; Tue, 8 May 2001 16:49:46 +1200 (NZT)
1098
-
1099
- Date: Tue, 08 May 2001 16:52:07 +1200
1100
- From: Murray Smith <
[email protected] >
1101
- Organization: University of Auckland
1102
- X-Mailer: Mozilla 4.76 [en] (WinNT; U)
1103
- X-Accept-Language: en
1104
- MIME-Version: 1.0
1105
-
1106
- Subject: ks.test in ctest package
1107
- Content-Type: text/plain; charset=us-ascii
1108
- Content-Transfer-Encoding: 7bit
1109
-
1110
-
1111
- 1. There is, I believe, some redundant code in the calculation of the
1112
- test statistic in ks.test in the package ctest.
1113
-
1114
- Lines 34-37 of the code read
1115
-
1116
- x <- y(sort(x), ...) - (0:(n - 1))/n
1117
- STATISTIC <- switch(alternative, two.sided = max(abs(c(x,
1118
- x - 1/n))), greater = max(c(x, x - 1/n)), less = -min(c(x,
1119
- x - 1/n)))
1120
-
1121
-
1122
- Lines 35-37 could read
1123
-
1124
- STATISTIC <- switch(alternative, two.sided = max(c(x,1/n - x)),
1125
- greater = max(x), less = max(1/n - x))
1126
-
1127
- Because
1128
-
1129
- x > x - 1/n and 1/n - x > -x,
1130
-
1131
- and thus
1132
-
1133
- max(abs(c(x, x - 1/n))) = max(c(x,1/n - x)),
1134
-
1135
- max(c(x, x - 1/n)) = max(x)
1136
-
1137
- and
1138
-
1139
- -min(c(x, x - 1/n)) = max (1/n - x)
1140
-
1141
- 2. The manual entry should also make it clear that the one-sided
1142
- tests are not about theactual cdf in relation to the null hypothsis cdf
1143
- Fo, but about the quantiles of the actual distribution in relation to
1144
- the quantiles of the null hypothesis cdf.
1145
-
1146
- For example the "greater" test has the STATISTIC, from line 34,
1147
-
1148
- y(sort(x)) - (0:(n-1))/n
1149
-
1150
- If this is large positive it would contain evidence that the actual cdf
1151
- F is less than the null hypothesis Fo. This is the traditional form of
1152
- the "less" alternative hypothesis.
1153
-
1154
- Ha: F < Fo
1155
-
1156
- is equivalent to the quantiles of the actual distribution being greater
1157
- than quantiles of the null hypothesised cdf Fo, consequently the manual
1158
- entry should make clear that the one sided alternatives "greater" or
1159
- "less" refers to the quantiles and not the cdf's.
1160
-
1161
- 3. Another feature that it would be very useful to add to ks.test
1162
- would be the automatic return of a confidence interval for the actual
1163
- cdf F. Adding a conf.level argument and taking the form of the interval
1164
- from the value of the alternative argument would be a relatively simple
1165
- task, although it would require . This would bring the value of the
1166
- function into line with the t.test function.
1167
-
1168
-
1169
- --
1170
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1171
- Murray H. Smith, Senior Lecturer in Engineering Statistics
1172
- Engineering Science Department
1173
- The University of Auckland
1174
- Private Bag 92019
1175
- Auckland
1176
- New Zealand
1177
- Phone: +64 9 373 7599 x4517, Fax: +64 9 373 7468
1178
-
1179
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1180
-
1181
-
1182
-
1183
- ==> 934.audit <==
1184
- Thu May 10 14:14:33 2001 ripley changed notes
1185
- Thu May 10 14:14:33 2001 ripley foobar
1186
- Thu May 10 14:14:33 2001 ripley moved from incoming to Analyses
1187
-
1188
- ==> 934.reply.1 <==
1189
- From
[email protected] Sun May 13 18:46:16 2001
1190
- Received: from mr.tuwien.ac.at (mr.tuwien.ac.at [128.130.2.10])
1191
- by pubhealth.ku.dk (8.9.3/8.9.1) with ESMTP id SAA21231
1192
- for <
[email protected] >; Sun, 13 May 2001 18:46:16 +0200 (MET DST)
1193
- Received: from mithrandir.hornik.net (a89.dialin.tuwien.ac.at [192.35.240.99])
1194
- by mr.tuwien.ac.at (8.11.1/8.11.1) with ESMTP id f4DGj4307800;
1195
- Sun, 13 May 2001 18:45:12 +0200 (MET DST)
1196
- Received: from hornik by mithrandir.hornik.net with local (Exim 3.12 #1 (Debian))
1197
- id 14yyty-0005XY-00; Sun, 13 May 2001 18:39:26 +0200
1198
- From: Kurt Hornik <
[email protected] >
1199
- MIME-Version: 1.0
1200
- Content-Type: text/plain; charset=us-ascii
1201
- Content-Transfer-Encoding: 7bit
1202
-
1203
- Date: Sun, 13 May 2001 18:39:26 +0200
1204
-
1205
-
1206
- Subject: Re: [Rd] ks.test in ctest package (PR#934)
1207
-
1208
-
1209
- X-Mailer: VM 6.92 under Emacs 20.7.2
1210
-
1211
- Sender: Kurt Hornik <
[email protected] >
1212
-
1213
- >>>>> mh smith writes:
1214
-
1215
- > 1. There is, I believe, some redundant code in the calculation of the
1216
- > test statistic in ks.test in the package ctest.
1217
-
1218
- Thanks, fixed.
1219
-
1220
- > 2. The manual entry should also make it clear that the one-sided
1221
- > tests are not about theactual cdf in relation to the null hypothsis cdf
1222
- > Fo, but about the quantiles of the actual distribution in relation to
1223
- > the quantiles of the null hypothesis cdf.
1224
-
1225
- > ...
1226
-
1227
- THanks for catching this bug. This should really give the usual
1228
- behavior that e.g. `alternative = "less"' means H_0: F >= F_0 for all
1229
- points vs H_a: F(t) < F_0(t) for some t. Fixed now.
1230
-
1231
- > 3. Another feature that it would be very useful to add to ks.test
1232
- > would be the automatic return of a confidence interval for the actual
1233
- > cdf F. Adding a conf.level argument and taking the form of the interval
1234
- > from the value of the alternative argument would be a relatively simple
1235
- > task, although it would require . This would bring the value of the
1236
- > function into line with the t.test function.
1237
-
1238
- I am not sure whether we want to do this in the simple htest framework.
1239
- Attempting to print a confidence interval given by two functions rather
1240
- than two values will be confusing. I'd much rather have users do
1241
-
1242
- confint(ecdf(x), conf.level = 0.95)
1243
-
1244
- where a generic confint as in MASS with a method for objects of class
1245
- "ecdf" as in stepfun.
1246
-
1247
- [The ``classical'' tests conceptually are really about a single
1248
- parameter only. Should this be changed? One could argue that if a
1249
- hypothesis about the underlying distribution function is tested ...]
1250
-
1251
- -k
1252
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1079
+ none
1253
1080
1254
1081
Directory: Documentation
1255
1082
0 commit comments