Paul Fenner wrote:
When I use the signrank test signrank y=0 I get the following result:
. signrank y=0
Ho: y = 0
z = 3.002
Prob > |z| = 0.0027
I then tried permute
permute y "signrank y=0" z=r(z), reps(1000) nowarn
command: signrank y=0
statistic: z = r(z)
permute var: y
Monte Carlo permutation statistics Number of obs =
20
Replications =
1000
------------------------------------------------------------------------------
T | T(obs) c n p=c/n SE(p) [95% Conf.
Interval]
-------------+---------------------------------------------------------------
z | 3.002347 1000 1000 1.0000 0.0000 .9963179
1
------------------------------------------------------------------------------
Note: confidence interval is with respect to p=c/n
Note: c = #{|T| >= |T(obs)|}
Would somebody please explain what is wrong with my syntax - or am I just
misunderstanding the output.
--------------------------------------------------------------------------------
It's your setup. The syntax of the typical use of -signrank- is
-signrank matched_pair_variable1 = matched_pair_variable2-.
You're using a syntax of having the signed ranks of matched-pair data already
calculated, i.e., of comparing a list of signed ranks (your variable y) to
zero. No matter how you permute the list of signed ranks, the comparison to a
constant won't change and so will never exceed the observed test statistic (it
will always exactly equal the observed test statistic, just as -permute-
indicated).
Joseph Coveney
P.S. I'm not sure that that hypothesis tested by -permute
matched_pair_variable1 "signrank matched_pair_variable1 =
matched_pair_variable2" z = r(z), reps()- would be the one you're looking for.
*
* 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/