Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Re: xsampsi produces inconsistent results
From 
 
Michael McCulloch <[email protected]> 
To 
 
[email protected] 
Subject 
 
Re: st: Re: xsampsi produces inconsistent results 
Date 
 
Sun, 6 Jun 2010 12:58:08 -0700 
Thank you Steve for the explanation.
On Jun 6, 2010, at 3:34 AM, Steve Samuels wrote:
In other words,  the effect size (3.651 = delta/sd)  is unrealistic;
the program is computing  n = 1 per group, with df = 0.  That the
program fails here is reasonable, although the error message could be
better.
Steve
On Sun, Jun 6, 2010 at 12:00 AM, Joseph Coveney <[email protected] 
> wrote:
Michael McCulloch wrote:
I'm using -xsampsi- to estimate sample sizes for a crossover  
experiment.
I compared two examples, each with alpha=0.25, and beta=0.20.
Experiment 1 (where mean difference =30, and its standard deviation =
45):
       xsampsi, alpha(0.025) beta(0.20) delta(30) stddev(45)
Experiment 2  (where mean difference =2.3, and its standard deviation
= 0.63):
       xsampsi, alpha(0.025) beta(0.20) delta(2.3) stddev(.63)
The first example produces a result, but the second leads to error
message:
       "Need to install package 'nct' to compute non-central t  
distribution"
However, I have installed -nct-.
Any feedback would be appreciated!
--------------------------------------------------------------------------------
The complete output of your second case is shown below.
You can see that it's trying to compute a t statistic of an N of 1,  
which gives
rise to a negative degrees of freedom for the quantile computation,  
which gives
rise to a missing value for the t quantile, which when fed to -nct-  
(set trace
on to see the call to -nct-) gives rise to a nonzero return code,  
which is
trapped with the omnibus (and in this case erroneous) error message.
-xsampsi- is user-written, not official.  I recommend contacting  
the author
with the bug report.
In the meantime, you can use simulation to do your power analysis.
Joseph Coveney
. xsampsi, alpha(0.025) beta(0.20) delta(2.3) stddev(.63)
Sample size for cross-over trial (AB/BA)
according to Senn 1991:  'Cross-over trials in clinical research'
Parameters below expressed in terms of the basic estimator, the  
treatment
contrast.
---------------
Alpha level    = 0.025  Power      = 0.800
Zalpha         = 2.241  Zbeta      = 0.842
Detectable effect size             = 2.300
Std.dev. of basic estimator        = 0.630
Approximate N (normal)             =    1
Critical value of t(df=-1,0.013)   =    .
Noncentrality parameter of t       = 3.651
Need to install package 'nct' to compute non-central t distribution
r(999);
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
--
Steven Samuels
[email protected]
18 Cantine's Island
Saugerties NY 12477
USA
Voice: 845-246-0774
Fax:    206-202-4783
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Best wishes,
Michael McCulloch, LAc MPH PhD
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/