[Gsdesign-commits] r275 - in pkg: gsDesign gsDesign/R gsDesign/man gsDesignGUI/inst/doc
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Feb 17 12:02:57 CET 2011
Author: keaven
Date: 2011-02-17 12:02:57 +0100 (Thu, 17 Feb 2011)
New Revision: 275
Modified:
pkg/gsDesign/NAMESPACE
pkg/gsDesign/R/gsqplot.R
pkg/gsDesign/man/gsBoundSummary.Rd
pkg/gsDesignGUI/inst/doc/gsDesignGUI.pdf
Log:
Added relative risk approximation and bound plot
Modified: pkg/gsDesign/NAMESPACE
===================================================================
--- pkg/gsDesign/NAMESPACE 2011-02-06 22:12:32 UTC (rev 274)
+++ pkg/gsDesign/NAMESPACE 2011-02-17 11:02:57 UTC (rev 275)
@@ -1,6 +1,6 @@
useDynLib(gsDesign)
export(gsBoundCP, gsCP, gsPP, gsPOS, gsCPOS, gsDensity)
-export(gsCPz, gsHR, gsDelta, gsBValue)
+export(gsCPz, gsHR, gsDelta, gsBValue, gsRR)
export(gsBound, gsBound1, gsDesign, gsProbability)
export(ciBinomial, nBinomial, simBinomial, testBinomial, gsBinomialExact)
export(nSurvival, nEvents)
Modified: pkg/gsDesign/R/gsqplot.R
===================================================================
--- pkg/gsDesign/R/gsqplot.R 2011-02-06 22:12:32 UTC (rev 274)
+++ pkg/gsDesign/R/gsqplot.R 2011-02-17 11:02:57 UTC (rev 275)
@@ -7,8 +7,10 @@
# plot.gsProbability
# gsCPz
# gsHR
+# gsRR
# gsDelta
# gsBValue
+# qplotit
#
# Hidden Functions:
#
@@ -21,7 +23,6 @@
# sfplot
# plotASN
# plotgsPower
-# qplotit
#
# Author(s): Keaven Anderson, PhD.
#
@@ -67,7 +68,8 @@
plotsf=c("5","sf"),
plotASN=c("6","asn", "e{n}","n"),
plotBval=c("7","b","b-val","b-value"),
- plotHR=c("8","hr","hazard"))
+ plotHR=c("8","hr","hazard"),
+ plotRR=c("9","rr"))
# perform partial matching on plot type and return name
plottype <- match.arg(tolower(as.character(plottype)), as.vector(unlist(plots)))
@@ -81,8 +83,9 @@
plotgsCP=c("4", "cp", "copp"),
plotASN=c("6","asn", "e{n}","n"),
plotBval=c("7","b","b-val","b-value"),
- plotHR=c("8","hr","hazard"))
-
+ plotHR=c("8","hr","hazard"),
+ plotRR=c("9","rr"))
+
# perform partial matching on plot type and return name
plottype <- match.arg(tolower(as.character(plottype)), as.vector(unlist(plots)))
names(plots)[which(unlist(lapply(plots, function(x, type) is.element(type, x), type=plottype)))]
@@ -96,6 +99,7 @@
expression(hat(theta)/theta[1]))),...)
}
"plotHR" <- function(x=x, ylab="Estimated hazard ratio",main="Hazard ratio at bounds",...){qplotit(x, fn=gsHR, ylab=ylab, main=main, ratio=1, ...)}
+"plotRR" <- function(x=x, ylab="Estimated risk ratio",main="Risk ratio at bounds",...){qplotit(x, fn=gsRR, ylab=ylab, main=main, ratio=1, ...)}
gsBValue <- function(z,i,x,ylab="B-value",...)
{ Bval <- z * sqrt(x$timing[i])
Bval
@@ -104,6 +108,10 @@
{ deltaHat <- z / sqrt(x$n.I[i]) * (x$delta1-x$delta0) / x$delta + x$delta0
deltaHat
}
+gsRR <- function(z, i, x, ratio=1, ylab="Estimated risk ratio",...)
+{ deltaHat <- z / sqrt(x$n.I[i]) * (x$delta1-x$delta0) / x$delta + x$delta0
+ exp(deltaHat)
+}
gsHR <- function(z, i, x, ratio=1, ylab="Estimated hazard ratio", ...)
{ c <- 1 / (1 + ratio)
psi <- c * (1 - c)
Modified: pkg/gsDesign/man/gsBoundSummary.Rd
===================================================================
--- pkg/gsDesign/man/gsBoundSummary.Rd 2011-02-06 22:12:32 UTC (rev 274)
+++ pkg/gsDesign/man/gsBoundSummary.Rd 2011-02-17 11:02:57 UTC (rev 275)
@@ -4,6 +4,7 @@
\alias{gsBValue}
\alias{gsDelta}
\alias{gsHR}
+\alias{gsRR}
\alias{gsCPz}
\title{2.8: Bound Summary and Z-transformations}
@@ -19,6 +20,7 @@
gsBValue <- function(z, i, x, ylab="B-value", ...)
gsDelta(z, i, x, ylab=NULL, ...)
gsHR(z, i, x, ratio=1, ylab="Estimated hazard ratio", ...)
+ gsRR(z, i, x, ratio=1, ylab="Estimated risk ratio",...)
gsCPz(z, i, x, theta=NULL, ylab=NULL, ...)
gsBoundSummary(x, upper=TRUE, ratio=1)
xtable.gsDesign(x, caption=NULL, label=NULL, align=NULL, digits=c(0,0,3,4,4,4,3,3,3,3),
@@ -111,4 +113,8 @@
# treatment effect at bounds is scaled to these differences
# in this case, this is the difference in event rates
gsDelta(z=xp$lower$bound, i=1:3, xp)
+# binomial endpoint with risk ratio estimates
+xrr <- gsDesign(n.fix=np, endpoint="Binomial", delta1=log(2/3))
+gsRR(z=xp$lower$bound, i=1:3, xrr)
+plot(xrr,plottype="RR")
}
Modified: pkg/gsDesignGUI/inst/doc/gsDesignGUI.pdf
===================================================================
(Binary files differ)
More information about the Gsdesign-commits
mailing list