Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Re: xsampsi produces inconsistent results


From   Steve Samuels <sjsamuels@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: xsampsi produces inconsistent results
Date   Sun, 6 Jun 2010 06:34:45 -0400

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 <jcoveney@bigplanet.com> 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
sjsamuels@gmail.com
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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index