Opened 6 years ago

Last modified 11 months ago

#2376 new enhancement

Add p-value for regression slope in r series

Reported by: mastho Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Raster Version: svn-releasebranch70
Keywords: r.series, p-value regression Cc: pvanbosgeo
CPU: Unspecified Platform: Unspecified

Description

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

Change History (12)

comment:1 Changed 6 years ago by neteler

Keywords: r.series p-value regressionr.series, p-value regression
Milestone: 7.0.0
Version: unspecifiedsvn-releasebranch70

comment:2 Changed 6 years ago by pvanbosgeo

Cc: pvanbosgeo added

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?

comment:3 in reply to:  2 Changed 6 years ago by mmetz

Replying to 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.

comment:4 Changed 4 years ago by martinl

Milestone: 7.0.07.0.5

comment:5 Changed 4 years ago by martinl

Milestone: 7.0.57.3.0

comment:6 Changed 4 years ago by martinl

Milestone: 7.3.07.4.0

Milestone renamed

comment:7 Changed 2 years ago by dvictori

You can calculate regression p-value using R and the raster package. Here is a StackOverflow? post about it:

https://stackoverflow.com/questions/20262999/how-to-output-regression-summarye-g-p-value-and-coeff-into-a-rasterbrick

comment:8 Changed 2 years ago by neteler

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:9 Changed 21 months ago by neteler

Milestone: 7.4.17.4.2

comment:10 Changed 17 months ago by martinl

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:11 Changed 13 months ago by martinl

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:12 Changed 11 months ago by martinl

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.