[Power-commits] r43 - in pkg/sse: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 18 21:33:03 CEST 2021


Author: thofab
Date: 2021-05-18 21:33:03 +0200 (Tue, 18 May 2021)
New Revision: 43

Modified:
   pkg/sse/DESCRIPTION
   pkg/sse/R/power.R
Log:
Adding an error message for method step, if the power of the example is high enough but not high enough for step method.


Modified: pkg/sse/DESCRIPTION
===================================================================
--- pkg/sse/DESCRIPTION	2020-02-04 15:06:28 UTC (rev 42)
+++ pkg/sse/DESCRIPTION	2021-05-18 19:33:03 UTC (rev 43)
@@ -1,7 +1,7 @@
 Package: sse
 Type: Package
 Title: Sample Size Estimation
-Version: 0.7-16
+Version: 0.7-17
 Author: Thomas Fabbro [aut, cre]
 Maintainer: Thomas Fabbro <thomas.fabbro at unibas.ch>
 URL: http://r-forge.r-project.org/projects/power/

Modified: pkg/sse/R/power.R
===================================================================
--- pkg/sse/R/power.R	2020-02-04 15:06:28 UTC (rev 42)
+++ pkg/sse/R/power.R	2021-05-18 19:33:03 UTC (rev 43)
@@ -1664,6 +1664,14 @@
                    "step" = {
                      element <- tail(which(dat.example$power < power.example),
                                      1) + 1
+                     if (element > nrow(dat.example)) {
+                         stop(strwrap(
+                              "The observed power for the example is to small
+                               for the step method.",
+                             prefix = " ", initial = ""),
+                             call. = FALSE)
+                         }
+                     
                      sample.size <- dat.example$sample.size[element]
                      ## for the inspection plot we need a line (based on
                      ## all data)



More information about the Power-commits mailing list