[Vegan-commits] r1283 - in pkg/vegan: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 25 15:25:27 CEST 2010


Author: jarioksa
Date: 2010-08-25 15:25:26 +0200 (Wed, 25 Aug 2010)
New Revision: 1283

Modified:
   pkg/vegan/R/ordiR2step.R
   pkg/vegan/inst/ChangeLog
Log:
ordiR2step uses P-value as the second criterion for adding a term

Modified: pkg/vegan/R/ordiR2step.R
===================================================================
--- pkg/vegan/R/ordiR2step.R	2010-08-25 11:13:31 UTC (rev 1282)
+++ pkg/vegan/R/ordiR2step.R	2010-08-25 13:25:26 UTC (rev 1283)
@@ -52,7 +52,17 @@
             cat("\n")
         }
         ## See if the best should be kept
+        ## First criterion: R2.adj improves and is still lower or
+        ## equal than for the full model of the scope
         if (R2.adds[best] > R2.previous && R2.adds[best] <= R2.all) {
+            ## Second criterion: added variable is significant
+            tst <- add1(object, scope = adds[best], test="permu")
+            if (trace) {
+                print(tst[-1,])
+                cat("\n")
+            }
+            if (tst[,"Pr(>F)"][2] > 0.05)
+                break
             fla <- paste("~  . +", adds[best])
             object <- update(object, fla)
             R2.previous <- RsquareAdj(object)$adj.r.squared

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-08-25 11:13:31 UTC (rev 1282)
+++ pkg/vegan/inst/ChangeLog	2010-08-25 13:25:26 UTC (rev 1283)
@@ -16,7 +16,10 @@
 	* biplot.CCorA: resets par that it sets.
 
 	* ordiR2step: can go to the end and include all variables of the
-	scope (and checks there is a scope).
+	scope (and checks there is a scope).  Added alternative stopping
+	criterion of exceeding P-value.  This is now hard-coded to P=0.05,
+	but will be changed to a configurable argument if the criterion is
+	deemed as useful feature to be kept.
 
 	* permutest.cca: defaults to 99 permutations instead of 100 (to
 	be consistent). Item 'call' now stores the call to permutest()



More information about the Vegan-commits mailing list