r.regression.line.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <H2>DESCRIPTION</H2>
  2. <EM>r.regression.line</EM> Calculates linear regression from two raster maps,
  3. according to the formula y = a + b*x, where x and y represent raster maps.
  4. Optionally saves regression coefficients to an ASCII file.
  5. The result includes the following coefficients:
  6. offset/intercept (a) and gain/slope (b), residuals (R),
  7. number of elements (N), means (medX, medY), standard deviations
  8. (sdX, sdY), and the F test for testing the significance of the
  9. regression model as a whole (F).
  10. <H2>NOTES</H2>
  11. The flag <em>-s</em> select the slower method (applies to FP maps only)
  12. which writes out all pixel values individually to the temporary file.
  13. The results for offset/intercept (a) and gain/slope (b) are then
  14. identical to that obtained from R-stats's lm() function.
  15. <H2>EXAMPLE</H2>
  16. Comparison of the old and the new DEM in Spearfish:
  17. <div class="code"><pre>
  18. g.region rast=elevation.10m -p
  19. r.regression.line map1=elevation.dem map2=elevation.10m
  20. </pre></div>
  21. <p>
  22. Using the script style flag AND <em>eval</em> to make results
  23. available in the shell:
  24. <div class="code"><pre>
  25. g.region rast=elevation.10m -p
  26. eval `r.regression.line -g map1=elevation.dem map2=elevation.10m`
  27. echo $a
  28. 479.615
  29. echo $b
  30. 0.645631
  31. echo $R
  32. 0.804441
  33. </pre></div>
  34. <H2>AUTHOR</H2>
  35. Dr. Agustin Lobo - alobo at ija.csic.es<BR>
  36. Updated to GRASS 5.7 Michael Barton, Arizona State University<BR>
  37. Script style output Markus Neteler
  38. <p><i>Last changed: $Date$</i>