Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.
y = a + b*x
x y
Optionally, it saves regression coefficients as a ASCII file. The result includes the following coefficients: offset/intercept (a) and gain/slope (b), correlation coefficient (R), number of elements (N), means (medX, medY), standard deviations (sdX, sdY), and the F test for testing the significance of the regression model as a whole (F).
g.region raster=elev_srtm_30m -p r.regression.line mapx=elev_ned_30m mapy=elev_srtm_30m y = a + b*x a (Offset): -1.659279 b (Gain): 1.043968 R (sumXY - sumX*sumY/N): 0.894038 N (Number of elements): 225000 F (F-test significance): 896093.366283 meanX (Mean of map1): 110.307571 sdX (Standard deviation of map1): 20.311998 meanY (Mean of map2): 113.498292 sdY (Standard deviation of map2): 23.718307
Using the script style flag AND eval to make results available in the shell:
g.region raster=elev_srtm_30m -p eval `r.regression.line -g mapx=elev_ned_30m mapy=elev_srtm_30m` # print result stored in respective variables echo $a -1.659279 echo $b 1.043968 echo $R 0.894038
Available at: r.regression.line source code (history)
Latest change: Thursday Feb 03 11:10:06 2022 in commit: 547ff44e6aecfb4c9cbf6a4717fc14e521bec0be
Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
© 2003-2023 GRASS Development Team, GRASS GIS 8.2.2dev Reference Manual