Statalist The Stata Listserver


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

Re: st: Re: permute


From   "Paul Fenner" <[email protected]>
To   [email protected]
Subject   Re: st: Re: permute
Date   Mon, 10 Jul 2006 13:59:31 +0000

Thank you very much for your assistance.
It has taken me a while to work out what is going on. I guess that my knowledge is not as good as I thought it was - back to the text books and more practice with permute for me!
Paul



From: Joseph Coveney <[email protected]>
Reply-To: [email protected]
To: Statalist <[email protected]>
Subject: Re: st: Re: permute
Date: Mon, 10 Jul 2006 18:37:03 +0900

Paul Fenner wrote:

I often have to analyse small datasets and I normally use StatXact. I no
longer have access to this program so I thought that I would use permute as
an option. When I use the ranksum test I get reasonable agrrement between
the probablities from StatXact and permute (e.g. asymptotic p=0.0749,
permute p=0.0789 and StatXact p=0.0794). However when I use signrank I get
no agreement at all e.g. asymptotic p 0.0431, permute p=1.00, StatXact
p=0.0079). The code I am using is:
permute diff z=r(z), reps(10000) nowarn: signrank diff=0

Could somebody tell me if my code is in error, or am I entirley incorrect in
using permute for exact calculations on small numbers.

--------------------------------------------------------------------------------

Your code is in error. It doesn't permute anything that matters.

Try something like that below to get close agreement with StatXact's
p-value. Don't worry that it uses -xtreg- for convenience; this is a
permutation test after all.

Joseph Coveney

clear
set more off
set seed `=date("2006-07-10", "ymd")'
set obs 10
generate float x0 = uniform()
generate float x1 = uniform()
signrank x0 = x1
generate byte pair = _n
reshape long x, i(pair) j(occasion)
permute occasion T = _b[occasion]/_se[occasion], ///
reps(10000) nodots: xtreg x occasion, i(pair) fe
exit


*
* 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/
_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters! http://www.msn.co.uk/newsletters

*
* 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