![]() |
![]()
| ![]() |
![]()
NAMEr.regression.line - Calculates linear regression from two raster maps: y = a + b*x. KEYWORDSraster, statistics, regression SYNOPSISr.regression.line
Flags:Parameters:
DESCRIPTIONr.regression.line calculates a linear regression from two
raster maps, according to the formula
y = a + b*x where
x y represent the input raster maps. 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). NOTESThe results for offset/intercept (a) and gain/slope (b) are identical to that obtained from R-stats’s lm() function. EXAMPLEComparison of two DEMs (SRTM and NED, both at 30m resolution),
provided in the North Carolina sample dataset:
g.region raster=elev_srtm_30m -p r.regression.line mapx=elev_ned_30m mapy=elev_srtm_30m 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 SEE ALSOd.correlate, r.regression.multi, r.stats AUTHORSDr. Agustin Lobo - alobo at ija.csic.es
SOURCE CODEAvailable at: r.regression.line source code (history) Latest change: Thursday Jan 26 14:10:26 2023 in commit: cdd84c130cea04b204479e2efdc75c742efc4843 Main index | Raster index | Topics index | Keywords index | Graphical index | Full index © 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual
|