[GRASS-dev] [GRASS GIS] #2376: Add p-value for regression slope in r series

#2376: Add p-value for regression slope in r series
-----------------------------------------+----------------------------------
Reporter: mastho | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Raster | Version: unspecified
Keywords: r.series p-value regression | Platform: Unspecified
      Cpu: Unspecified |
-----------------------------------------+----------------------------------
The calculation of t-values has been added to r.series in r53742
(method=tvalue). It would be nice to have also the corresponding p-values
for the regression as method in r.series.

Also discussed here:
http://osgeo-org.1560.x6.nabble.com/Calculate-p-value-for-regression-
slope-in-r-series-td5014228.html

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2376&gt;
GRASS GIS <http://grass.osgeo.org>

#2376: Add p-value for regression slope in r series
------------------------------------------+---------------------------------
Reporter: mastho | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-releasebranch70
Keywords: r.series, p-value regression | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------------+---------------------------------
Changes (by neteler):

  * keywords: r.series p-value regression => r.series, p-value regression
  * version: unspecified => svn-releasebranch70
  * milestone: => 7.0.0

Comment:

See especially
  * http://lists.osgeo.org/pipermail/grass-user/2012-November/066132.html
  * http://lists.osgeo.org/pipermail/grass-user/2012-November/066141.html

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2376#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2376: Add p-value for regression slope in r series
------------------------------------------+---------------------------------
Reporter: mastho | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-releasebranch70
Keywords: r.series, p-value regression | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------------+---------------------------------
Changes (by pvanbosgeo):

* cc: pvanbosgeo (added)

Comment:

You can calculate the p-value using the scipy library (from
http://stackoverflow.com/questions/17559897/python-p-value-
from-t-statistic). For example, if tt is the t value

{{{
import scipy.stats as stats
import numpy as np
tt = 2.4
n = 10
pval = stats.t.sf(np.abs(tt), n-1)*2 (two-sided p-value)
}}}

Perhaps this can be used either to create a script or in r.series?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2376#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2376: Add p-value for regression slope in r series
------------------------------------------+---------------------------------
Reporter: mastho | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-releasebranch70
Keywords: r.series, p-value regression | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------------+---------------------------------

Comment(by mmetz):

Replying to [comment:2 pvanbosgeo]:
> You can calculate the p-value using the [python] scipy library

Considering that you want to calculate a p value for each single pixel,
the chances that you get randomly some very small p values increase with
the number of pixels. You would need to correct for that, with Bonferroni
or some method that escapes the iron claw of Bonferroni. In any case, all
your p values will most probably become not significant after any method
of correction for multiple testing.

Therefore it is more appropriate to make prior assumptions about slope,
intercept, and effect size, then judge the results according to these
prior assumptions.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2376#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>