"Ethan Johnsons" <[EMAIL PROTECTED]> writes:

> What would be the R formulae for a two-sided test?
> 
> I have a formula for a one-sided test:
> 
> powertest <- function(a,m0,m1,n,s){
> t1 = -qnorm(1-a)
> num = abs(m0-m1) * sqrt(n)
> t2 = num/s
> pow = pnorm(t1 + t2)
> }
> 
> Would you pls let me know if you know of?

(Notice that power.t.test does this more accurately)

For practical purposes, just halve a. Perfectionists may want you to
add pnorm(t1 - t2), so that the total power becomes a when t2 == 0.

BTW: -qnorm(1-a)==qnorm(a)

-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])                  FAX: (+45) 35327907

______________________________________________
[email protected] 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