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
step...@prollenium.com

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


On 01 Oct 2014, at 14:29 , Stephen Kennedy <step...@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....@cbs.dk  Priv: pda...@gmail.com










        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to