Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -jonter- updated again on SSC


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   st: -jonter- updated again on SSC
Date   Thu, 07 Dec 2006 20:24:53 +0900

Thanks to Kit Baum, there is a new update of -jonter- on SSC.  This update
adds a couple of new options, and -jonter- now automatically corrects the
asymptotically normal test statistic, J*, for tied values in -varname-.

Tie-correction of J* should improve asymptotic p-values when users
apply -jonter- to ordered-category contingency tables.  The actual
nonparametric test statistic, J, always has been corrected for ties, by
taking midranks.  Permutation testing using J was (and is still) the way to
go if you're using -jonter- for these kinds of situations.  Toward that end,
there is a new option, -jonly- that causes -jonter- to exit after
calculating only J.  This pre-empts the computations involved in J* and
shortens execution time.  This should cut overall time when using -jonter-
with -permute-.

In addition, the new version adds p-values for descending order.  This
allows the use of -jonter- with inversely related variables without having
to manually reverse the order of one of the variables.  The two-tailed
p-value is also reported, for when the user cannot legitimately employ a
one-tailed test.  All three p-values are returned as scalars, just as are
both test statistics.

Last, there is a new option -continuity-, which adds a continuity correction
to the asymptotic test statistic (J*).  The sources that I've run across
have been mixed about what kind of continuity correction to use for the
Jonckheere-Terpstra test.  Unity is used by some and one-half by others.
The continuity correction used in this version of -jonter- is unity, but
simulations that I've done indicate that it doesn't matter much:  both yield
test sizes and power the same as -ktau-, except when there is extensive
tying in -varname- ("extensive" meaning "as in a contingency table"), when
the unity correction tends to make the test more conservative than -ktau-,
and the one-half correction makes it only as conservative as -ktau-
(compared to -nptrend-, or to -jonter- without the correction).  For those
who would like to use one-half for the continuity correction, the current
version of -jonter- also returns the denominator (SE of J) that goes into
J*, and you can use it (after running -jonter . . . continuity-) to back-out
the continuity correction from unity to one-half with the following code:

local Jstar = (r(Jstar) * r(se_Jstar) + sign(r(Jstar)) * 0.5) / r(se_Jstar)

and then use `Jstar' in -normal()- for calculation of p-values.

Bug reports and suggestions for further improvements are welcome.  (I've
already noticed one goof-up--the inequality signs point in the wrong
direction for the one-tailed tests in the printout--but it's not worth
bugging Kit to upload a correction for that alone.)

Joseph Coveney


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index