[R] power.t.test threading on 'power'

Stephen Kennedy stephen at prollenium.com
Fri Oct 3 19:51:16 CEST 2014


Dear Professor Dalgard,

I wondered if I might ask a general question on ‘power’.  Please feel free to ignore.

For ‘non-inferiority’ clinical trials:

H0: m1 - m2 ≤  -M

Ha: m1 - m2 > -M

But when calculations are done (normal, t, or non-central t … still learning what this is), 

Ha: m1 - m2 = 0

is assumed (for power, n, …) .  

Why not average (integrate numerically) the results from -M to infinity and keep the original alternative hypothesis?  

In fact, calculation of the Type I error is made assuming m1 - m2 = -M, which doesn’t seem strictly accurate either.

Best,

Steve


Stephen J. Kennedy, Ph.D.
Director, Research & Development
Prollenium Medical Technologies, Inc.
138 Industrial Parkway North
Aurora, ON
L4G 4C3 Canada
+1 (905) 508-1469 X223
Stephen at Prollenium.com

On Oct 1, 2014, at 6:46 PM, peter dalgaard <pdalgd at gmail.com> wrote:


On 01 Oct 2014, at 14:29 , Stephen Kennedy <stephen at prollenium.com> wrote:

> Simple question.  A vector of ‘number of observations’ can be input to power.t.test, and a vector of ‘power’ s is output.  But, inputting a vector of powers generates an error.  Am I missing something?

Power.t.test was written for scalar arguments. If it happens to work with vector arguments, it is entirely coincidental. The essence of what you observe is that power is calculated by pt() which vectorizes, but n is calculated by numerical solution using uniroot() which does not vectorize. 

If you need a vectorized version, check out Vectorize().

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com










	[[alternative HTML version deleted]]



More information about the R-help mailing list