[Gsdesign-commits] r332 - in pkg/gsDesign: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 2 19:30:24 CEST 2012


Author: keaven
Date: 2012-05-02 19:30:24 +0200 (Wed, 02 May 2012)
New Revision: 332

Modified:
   pkg/gsDesign/DESCRIPTION
   pkg/gsDesign/NAMESPACE
   pkg/gsDesign/R/nEvents.R
   pkg/gsDesign/man/nSurvival.Rd
   pkg/gsDesign/man/sfLinear.Rd
Log:
Adding gsSurv for new survival capabilities in v 2.7

Modified: pkg/gsDesign/DESCRIPTION
===================================================================
--- pkg/gsDesign/DESCRIPTION	2012-02-12 14:53:24 UTC (rev 331)
+++ pkg/gsDesign/DESCRIPTION	2012-05-02 17:30:24 UTC (rev 332)
@@ -1,5 +1,5 @@
 Package: gsDesign
-Version: 2.6-04
+Version: 2.7-02
 Title: Group Sequential Design
 Author: Keaven Anderson 
 Maintainer: Keaven Anderson <keaven_anderson at merck.com>

Modified: pkg/gsDesign/NAMESPACE
===================================================================
--- pkg/gsDesign/NAMESPACE	2012-02-12 14:53:24 UTC (rev 331)
+++ pkg/gsDesign/NAMESPACE	2012-05-02 17:30:24 UTC (rev 332)
@@ -10,3 +10,4 @@
 export(sfPower, sfHSD, sfExponential, sfBetaDist, sfLDOF, sfLDPocock, sfPoints, sfLogistic, sfExtremeValue, sfExtremeValue2, sfLinear, sfTruncated)
 export(sfCauchy, sfNormal, sfTDist, spendingFunction)
 export(checkScalar, checkVector, checkRange, checkLengths, isInteger)
+export(eEvents, print.eEvents, nSurv, gsSurv, print.nSurv, print.gsSurv, tEventsIA, nEventsIA)

Modified: pkg/gsDesign/R/nEvents.R
===================================================================
--- pkg/gsDesign/R/nEvents.R	2012-02-12 14:53:24 UTC (rev 331)
+++ pkg/gsDesign/R/nEvents.R	2012-05-02 17:30:24 UTC (rev 332)
@@ -17,18 +17,18 @@
         return(pwr)
     }
 }
-"zn2hr" <- function (z, n , ratio = 1) 
+"zn2hr" <- function (z, n , ratio = 1, hr0=1, hr1=.7) 
 {   c <- 1/(1 + ratio)
     psi <- c * (1 - c)
-    exp(-z/sqrt(n * psi))
+    exp(z * sign(hr1-hr0)/sqrt(n * psi)) * hr0
 }
-"hrn2z" <- function(hr, n, ratio=1)
+"hrn2z" <- function(hr, n, ratio=1, hr0=1, hr1=.7)
 {   c <- 1/(1 + ratio)
     psi <- c * (1 - c)
-    log(hr) * sqrt(n * psi)
+    log(hr/hr0) * sqrt(n * psi) * sign(hr0-hr1)
 }
-"hrz2n" <- function(hr, z, ratio=1)
+"hrz2n" <- function(hr, z, ratio=1, hr0=1)
 {   c <- 1 / (1 + ratio)
     psi <- c * (1 - c)
-    (z / log(hr))^2 / psi
+    (z / log(hr/hr0))^2 / psi
 }

Modified: pkg/gsDesign/man/nSurvival.Rd
===================================================================
--- pkg/gsDesign/man/nSurvival.Rd	2012-02-12 14:53:24 UTC (rev 331)
+++ pkg/gsDesign/man/nSurvival.Rd	2012-05-02 17:30:24 UTC (rev 332)
@@ -18,9 +18,9 @@
       type = c("rr", "rd"), entry = c("unif", "expo"), gamma = NA)
 \method{print}{nSurvival}(x,...)
 nEvents(hr = .6, alpha = .025, beta = .1, ratio = 1, sided = 1, hr0 =  1, n = 0, tbl = FALSE)
-hrn2z(hr, n, ratio=1)
-hrz2n(hr, z, ratio=1)
-zn2hr(z, n, ratio=1)
+hrn2z(hr, n, ratio=1, hr0=1, hr1=.7)
+hrz2n(hr, z, ratio=1, hr0=1)
+zn2hr(z, n, ratio=1, hr0=1, hr1=.7)
 }
 \arguments{
   \item{lambda1, lambda2}{event hazard rate for placebo and treatment
@@ -45,7 +45,8 @@
   \item{x}{An object of class "nSurvival" returned by \code{nSurvival()}
    (optional: used for output; "months" or "years" would be the 'usual' choices).}
   \item{hr}{Hazard ratio. For \code{nEvents}, this is the hazard ratio under the alternative hypothesis (>0).}
-  \item{hr0}{Hazard ratio under the null hypothesis (>0, != \code{hr}).}
+  \item{hr0}{Hazard ratio under the null hypothesis (>0, for \code{nEvents}, \code{!= hr}).}
+  \item{hr1}{Hazard ratio under the alternate hypothesis for \code{hrn2z, zn2hr} (>0, \code{!= hr0})}
   \item{n}{Number of events. For \code{nEvents} may be input to compute power rather than sample size.}
   \item{tbl}{Indicator of whether or not scalar (vector) or tabular output is desired for \code{nEvents()}.}
   \item{z}{A z-statistic.}
@@ -167,6 +168,10 @@
 
 # approximate hazard ratio corresponding to 100 events and z-statistic of 2
 zn2hr(n=100,z=2)
+# same when hr0 is 1.1
+zn2hr(n=100,z=2,hr0=1.1)
+# same when hr0 is .9 and hr1 is greater than hr0
+zn2hr(n=100,z=2,hr0=.9,hr1=1)
 
 # approximate number of events corresponding to z-statistic of 2 and 
 # estimated hazard ratio of .5 (or 2)

Modified: pkg/gsDesign/man/sfLinear.Rd
===================================================================
--- pkg/gsDesign/man/sfLinear.Rd	2012-02-12 14:53:24 UTC (rev 331)
+++ pkg/gsDesign/man/sfLinear.Rd	2012-05-02 17:30:24 UTC (rev 332)
@@ -21,7 +21,7 @@
 	sample size or information for which the spending function will be computed.}
 	\item{param}{A vector with a positive, even length. Values must range from 0 to 1, inclusive.
 Letting \code{m <- length(param/2)}, the first \code{m} points in param specify increasing values strictly between 0 and 1,
-where the proportion of total spending is specified. 
+where the interim timing (proportion of final total statistical information) where spending is to be specified is given. 
 The last \code{m} points in param specify non-decreasing values from 0 to 1, inclusive, 
 with the cumulative proportion of spending at the timepoints in the first part of the vector.}
 }



More information about the Gsdesign-commits mailing list