Opened 8 years ago

# Add p-value for regression slope in r series

Reported by: Owned by: mastho grass-dev@… normal 7.6.2 Raster svn-releasebranch70 r.series, p-value regression pvanbosgeo Unspecified 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.

### comment:1 by neteler, 8 years ago

Keywords: r.series p-value regression → r.series, p-value regression → 7.0.0 unspecified → svn-releasebranch70

### follow-up:  3 comment:2 by pvanbosgeo, 8 years ago

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?

### in reply to:  2 comment:3 by mmetz, 8 years ago

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 by martinl, 6 years ago

Milestone: 7.0.0 → 7.0.5

### comment:5 by martinl, 6 years ago

Milestone: 7.0.5 → 7.3.0

### comment:6 by martinl, 6 years ago

Milestone: 7.3.0 → 7.4.0

Milestone renamed

### comment:7 by dvictori, 5 years ago

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

### comment:8 by neteler, 4 years ago

Milestone: 7.4.0 → 7.4.1

Ticket retargeted after milestone closed

### comment:9 by neteler, 4 years ago

Milestone: 7.4.1 → 7.4.2

### comment:10 by martinl, 4 years ago

Milestone: 7.4.2 → 7.6.0

All enhancement tickets should be assigned to 7.6 milestone.

### comment:11 by martinl, 3 years ago

Milestone: 7.6.0 → 7.6.1

Ticket retargeted after milestone closed

### comment:12 by martinl, 3 years ago

Milestone: 7.6.1 → 7.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.