[Gsdesign-commits] r329 - in pkg/gsDesign: . R man src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Dec 30 15:30:05 CET 2011
Author: keaven
Date: 2011-12-30 15:30:05 +0100 (Fri, 30 Dec 2011)
New Revision: 329
Modified:
pkg/gsDesign/DESCRIPTION
pkg/gsDesign/NAMESPACE
pkg/gsDesign/R/gsBinomial.R
pkg/gsDesign/R/nNormal.R
pkg/gsDesign/man/spendingfunctions.Rd
pkg/gsDesign/src/gsbound.c
pkg/gsDesign/src/gsbound1.c
pkg/gsDesign/src/hupdate.c
Log:
Updates for minor R 2.14 build issues (nNormal, simBinomial)
Modified: pkg/gsDesign/DESCRIPTION
===================================================================
--- pkg/gsDesign/DESCRIPTION 2011-12-30 12:44:18 UTC (rev 328)
+++ pkg/gsDesign/DESCRIPTION 2011-12-30 14:30:05 UTC (rev 329)
@@ -1,5 +1,5 @@
Package: gsDesign
-Version: 2.6-01
+Version: 2.6-02
Title: Group Sequential Design
Author: Keaven Anderson
Maintainer: Keaven Anderson <keaven_anderson at merck.com>
@@ -7,4 +7,4 @@
Description: gsDesign is a package that derives group sequential designs and describes their properties.
License: GPL (>= 2)
Copyright: Copyright 2010, Merck Research Laboratories
-Packaged: Thu Aug 6 17:28:16 2009; anderkea
+Packaged: 2011-12-30 13:26:23 UTC; Anderkea
Modified: pkg/gsDesign/NAMESPACE
===================================================================
--- pkg/gsDesign/NAMESPACE 2011-12-30 12:44:18 UTC (rev 328)
+++ pkg/gsDesign/NAMESPACE 2011-12-30 14:30:05 UTC (rev 329)
@@ -3,7 +3,7 @@
export(gsCPz, gsHR, gsDelta, gsBValue, gsRR, hrn2z, hrz2n, zn2hr)
export(gsBound, gsBound1, gsDesign, gsProbability)
export(ciBinomial, nBinomial, simBinomial, testBinomial, gsBinomialExact)
-export(nSurvival, nEvents)
+export(nSurvival, nEvents, nNormal)
export(normalGrid)
export(plot.gsDesign, plot.gsProbability, print.gsProbability, print.gsDesign)
export(print.nSurvival, xtable.gsDesign, gsBoundSummary)
Modified: pkg/gsDesign/R/gsBinomial.R
===================================================================
--- pkg/gsDesign/R/gsBinomial.R 2011-12-30 12:44:18 UTC (rev 328)
+++ pkg/gsDesign/R/gsBinomial.R 2011-12-30 14:30:05 UTC (rev 329)
@@ -279,8 +279,8 @@
checkScalar(nsim, "integer", c(1, Inf))
checkLengths(p1, p2)
- x1 <- rbinom(p=p1, size=n1, n=nsim)
- x2 <- rbinom(p=p2, size=n2, n=nsim)
+ x1 <- rbinom(prob=p1, size=n1, n=nsim)
+ x2 <- rbinom(prob=p2, size=n2, n=nsim)
scale <- match.arg(tolower(scale), c("difference", "rr", "or", "lnor"))
testBinomial(x1=x1, x2=x2, n1=n1, n2=n2, delta0=delta0, adj=adj,
Modified: pkg/gsDesign/R/nNormal.R
===================================================================
--- pkg/gsDesign/R/nNormal.R 2011-12-30 12:44:18 UTC (rev 328)
+++ pkg/gsDesign/R/nNormal.R 2011-12-30 14:30:05 UTC (rev 329)
@@ -1,14 +1,11 @@
-# sample size for fixed design with 2-arms, normal endpoint,
-# ratio = randomization ratio
-nNormal<-function(delta1=1,sigma=1.7,sigalt=NULL,alpha=.025,beta=.1,ratio=1,
- sided=1, n=NULL,delta0=0)
-{ xi <- ratio/(1+ratio)
- if (sided==2) alpha <- alpha/2
- if(is.null(sigalt)) sigalt <- sigma
- v <- sigalt^2/xi + sigma^2/(1-xi)
- theta1 <- (delta1-delta0)/sqrt(v)
- if (is.null(n))
- return(((qnorm(alpha)+qnorm(beta))/theta1)^2)
- else
- return(pnorm(sqrt(n)*theta1-qnorm(1-alpha)))
+"nNormal" <- function(delta1=1, sigma=1.7, sigalt=NULL, alpha=.025,
+ beta=.1, ratio=1, sided=1, n=NULL, delta0=0)
+{ xi <- ratio/(1+ratio)
+ if (is.null(sigalt)) sigalt <- sigma
+ v <- sigalt^2/xi + sigma^2/(1-xi)
+ theta1 <- (delta1-delta0)/sqrt(v)
+ if (is.null(n))
+ return(((qnorm(alpha/sided)+qnorm(beta))/theta1)^2)
+ else
+ return(pnorm(sqrt(n)*theta1-qnorm(1-alpha/sided)))
}
Modified: pkg/gsDesign/man/spendingfunctions.Rd
===================================================================
--- pkg/gsDesign/man/spendingfunctions.Rd 2011-12-30 12:44:18 UTC (rev 328)
+++ pkg/gsDesign/man/spendingfunctions.Rd 2011-12-30 14:30:05 UTC (rev 329)
@@ -49,7 +49,9 @@
}
\seealso{\code{\link{gsDesign}}, \code{\link{sfHSD}}, \code{\link{sfPower}},
-\code{\link{sfLogistic}}, \code{\link{sfExponential}}, \link{Wang-Tsiatis Bounds}, \link{gsDesign package overview}
+\code{\link{sfLogistic}}, \code{\link{sfExponential}},
+\code{\link{sfTruncated}},
+\link{Wang-Tsiatis Bounds}, \link{gsDesign package overview}
}
\note{The manual is not linked to this help file, but is available in library/gsdesign/doc/gsDesignManual.pdf
in the directory where R is installed.}
Modified: pkg/gsDesign/src/gsbound.c
===================================================================
--- pkg/gsDesign/src/gsbound.c 2011-12-30 12:44:18 UTC (rev 328)
+++ pkg/gsDesign/src/gsbound.c 2011-12-30 14:30:05 UTC (rev 329)
@@ -100,9 +100,9 @@
/* if convergence did not occur, set flag for return value */
if (adelta>tol ||bdelta > tol)
{ if (*printerr)
- { printf("gsbound1 error: No convergence for boundary for interim %d; I=%7.0lf",i+1,I[i]);
- if (bdelta>tol) printf("\n last 2 upper boundary values: %lf %lf\n",btem,btem2);
- if (adelta>tol) printf("\n last 2 lower boundary values: %lf %lf\n",atem,atem);
+ { Rprintf("gsbound1 error: No convergence for boundary for interim %d; I=%7.0lf",i+1,I[i]);
+ if (bdelta>tol) Rprintf("\n last 2 upper boundary values: %lf %lf\n",btem,btem2);
+ if (adelta>tol) Rprintf("\n last 2 lower boundary values: %lf %lf\n",atem,atem);
}
retval[0]=1;
return;
Modified: pkg/gsDesign/src/gsbound1.c
===================================================================
--- pkg/gsDesign/src/gsbound1.c 2011-12-30 12:44:18 UTC (rev 328)
+++ pkg/gsDesign/src/gsbound1.c 2011-12-30 14:30:05 UTC (rev 329)
@@ -91,7 +91,7 @@
problo[i]=plo;
/* if convergence did not occur, set flag for return value */
if (bdelta > tol)
- { if (*printerr) printf("gsbound1 error: No convergence for boundary for interim %d; I=%7.0lf; last 2 upper boundary values: %lf %lf\n",
+ { if (*printerr) Rprintf("gsbound1 error: No convergence for boundary for interim %d; I=%7.0lf; last 2 upper boundary values: %lf %lf\n",
i+1,I[i],btem,btem2);
retval[0]=1;
}
Modified: pkg/gsDesign/src/hupdate.c
===================================================================
--- pkg/gsDesign/src/hupdate.c 2011-12-30 12:44:18 UTC (rev 328)
+++ pkg/gsDesign/src/hupdate.c 2011-12-30 14:30:05 UTC (rev 329)
@@ -12,14 +12,9 @@
rtIkm1=sqrt(Ikm1);
for(i=0;i<=m2;i++)
{ hk[i]=0.;
- /*if(i==0) printf("z h zadj h*f:\n");*/
for(ii=0;ii<=m1;ii++)
{ x=(zk[i]*rtIk-zkm1[ii]*rtIkm1-theta*deltak)/rtdeltak;
hk[i]+=hkm1[ii]*exp(-x*x/2)/2.506628275*rtIk/rtdeltak;
- /* if (i==0) printf("%lf %lf %lf %lf\n",zkm1[ii],hkm1[ii],x,
- hkm1[ii]*exp(-x*x/2)/2.506628275);*/
}
hk[i]*=wgt[i];
- /*if(i==0) printf("z w h:\n");
- printf("%lf %lf %lf\n",zk[i],wgt[i],hk[i]);*/
} }
More information about the Gsdesign-commits
mailing list