[Gsdesign-commits] r149 - pkg/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 6 17:49:23 CEST 2009


Author: keaven
Date: 2009-05-06 17:49:22 +0200 (Wed, 06 May 2009)
New Revision: 149

Modified:
   pkg/man/binomial.Rd
   pkg/man/sfpoints.Rd
Log:
Example updates in binomial.Rd, sfPoints.Rd

Modified: pkg/man/binomial.Rd
===================================================================
--- pkg/man/binomial.Rd	2009-05-05 22:09:14 UTC (rev 148)
+++ pkg/man/binomial.Rd	2009-05-06 15:49:22 UTC (rev 149)
@@ -153,11 +153,12 @@
 x0
 pnorm(x0, lower.tail=FALSE)
 
-# Perform 500k simulations to test validity of the above asymptotic p-values 
+# Perform 50k simulations to test validity of the above asymptotic p-values 
+# (you may want to perform more to reduce standard error of estimate)
 sum(as.real(x0) <= 
-    simBinomial(p1=.078, p2=.078, n1=500, n2=500, nsim=500000)) / 500000
+    simBinomial(p1=.078, p2=.078, n1=500, n2=500, nsim=50000)) / 50000
 sum(as.real(x0) <= 
-    simBinomial(p1=.052, p2=.052, n1=500, n2=500, nsim=500000)) / 500000
+    simBinomial(p1=.052, p2=.052, n1=500, n2=500, nsim=50000)) / 50000
 
 # Perform a non-inferiority test to see if p2=400 / 500 is within 5% of 
 # p1=410 / 500 use a z-statistic with unadjusted variance
@@ -172,7 +173,7 @@
 
 # now simulate the z-statistic witthout continuity corrected variance
 sum(qnorm(.975) <= 
-    simBinomial(p1=.8, p2=.8, n1=500, n2=500, nsim=1000000)) / 1000000
+    simBinomial(p1=.8, p2=.8, n1=500, n2=500, nsim=100000)) / 100000
 
 # compute a sample size to show non-inferiority with 5% margin, 90% power
 nBinomial(p1=.2, p2=.2, delta0=.05, alpha=.025, sided=1, beta=.1)

Modified: pkg/man/sfpoints.Rd
===================================================================
--- pkg/man/sfpoints.Rd	2009-05-05 22:09:14 UTC (rev 148)
+++ pkg/man/sfpoints.Rd	2009-05-06 15:49:22 UTC (rev 149)
@@ -56,8 +56,10 @@
     ylab="Cumulative proportion of spending", 
     type="p")
 
+# following lines produce error when compiling package on some systems
 # approximate this with a t-distribution spending function by fitting 3 points
-lines(t, sfTDist(1, t, c(c(1, 3, 5)/6, .01, .1, .5))$spend)
+tx <- 0:100/100
+lines(tx, sfTDist(1, tx, c(c(1, 3, 5)/6, .01, .1, .5))$spend)
 text(x=.6, y=.9, labels="Pointwise Spending Approximated by")
 text(x=.6, y=.83, "t-Distribution Spending with 3-point interpolation")
 }



More information about the Gsdesign-commits mailing list