[R] query: sample size calculation

From: <ManuelPerera-Chang_at_fmc-ag.com>
Date: Fri 26 May 2006 - 22:57:02 EST

Dear all,

I am doing something wrong.

I am trying to apply a formula for sample size calculation as in the book "Design and Analysis of Clinical Trials", from Chow et all.

There a suggested sample size strategy uses the formula

0.30/0.45=F(0.80,2n,2n)/F(0.025,2n,2n)

which gives n=96, as in the book.

(here F(alfa,k,n) is the upper (alfa)th quantile of an F distribution with k,n degrees of freedom)

I have been trying to get n=96 using the following code in R.

val<-rep(NA,200)
 for (n in 1:200) {
  val[n]<- qf(0.8, 2*n, 2*n,lower.tail = TRUE, log.p = FALSE)/qf(0.025,
2*n, 2*n,lower.tail = TRUE, log.p = FALSE);  }

but val doesnot get any close to 0.30/0.45.

Thank you,

Manuel



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri May 26 23:03:59 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 27 May 2006 - 00:10:19 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.