[Gsdesign-commits] r367 - pkg/gsDesign/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat May 24 11:53:14 CEST 2014


Author: keaven
Date: 2014-05-24 11:53:13 +0200 (Sat, 24 May 2014)
New Revision: 367

Modified:
   pkg/gsDesign/R/nEvents.R
Log:
nEvents table output changed to data.frame class

Modified: pkg/gsDesign/R/nEvents.R
===================================================================
--- pkg/gsDesign/R/nEvents.R	2014-02-24 00:19:38 UTC (rev 366)
+++ pkg/gsDesign/R/nEvents.R	2014-05-24 09:53:13 UTC (rev 367)
@@ -4,16 +4,18 @@
     delta <- -c * (log(hr) - log(hr0))
     if (n[1] == 0)
     {   n <- (qnorm(1-alpha/sided)+qnorm(1-beta))^2/delta^2
-        if (tbl) n <- cbind(hr = hr, n = ceiling(n), alpha = alpha, sided=sided, beta = beta, 
+        if (tbl) n <- data.frame(cbind(hr = hr, n = ceiling(n), alpha = alpha,
+									 sided=sided, beta = beta, 
                             Power = 1-beta, delta = delta, ratio = ratio, 
-                            hr0 = hr0, se = 1/c/sqrt(ceiling(n)))
+                            hr0 = hr0, se = 1/c/sqrt(ceiling(n))))
         return(n)
     }
     else
     {   pwr <- pnorm(-(qnorm(1-alpha/sided)-sqrt(n) * delta))
-        if (tbl) pwr <- cbind(hr = hr, n = n, alpha = alpha, sided=sided, beta = 1-pwr,
+        if (tbl) pwr <- data.frame(cbind(hr = hr, n = n, alpha = alpha,
+									 sided=sided, beta = 1-pwr,
                             Power = pwr, delta = delta, ratio = ratio,
-                            hr0 = hr0, se = sqrt(1/n)/c)
+                            hr0 = hr0, se = sqrt(1/n)/c))
         return(pwr)
     }
 }



More information about the Gsdesign-commits mailing list