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]

From |
"Joseph Coveney" <jcoveney@bigplanet.com> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: Re: xsampsi produces inconsistent results |

Date |
Sun, 6 Jun 2010 13:00:10 +0900 |

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/

**Follow-Ups**:**Re: st: Re: xsampsi produces inconsistent results***From:*Steve Samuels <sjsamuels@gmail.com>

**References**:**st: xsampsi produces inconsistent results***From:*Michael McCulloch <mm@pinestreetfoundation.org>

- Prev by Date:
**st: Time dependent ROC** - Next by Date:
**st: AW: -ssc- commands** - Previous by thread:
**st: xsampsi produces inconsistent results** - Next by thread:
**Re: st: Re: xsampsi produces inconsistent results** - Index(es):