r.regression.multi.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <h2>DESCRIPTION</h2>
  2. <em>r.regression.multi</em> calculates a multiple linear regression from
  3. raster maps, according to the formula
  4. <div class="code"><pre>
  5. Y = b0 + sum(bi*Xi) + E
  6. </pre></div>
  7. where
  8. <div class="code"><pre>
  9. X = {X1, X2, ..., Xm}
  10. m = number of explaining variables
  11. Y = {y1, y2, ..., yn}
  12. Xi = {xi1, xi2, ..., xin}
  13. E = {e1, e2, ..., en}
  14. n = number of observations (cases)
  15. </pre></div>
  16. In R notation:
  17. <div class="code"><pre>
  18. Y ~ sum(bi*Xi)
  19. b0 is the intercept, X0 is set to 1
  20. </pre></div>
  21. <p>
  22. <em>r.regression.multi</em> is designed for large datasets that can not
  23. be processed in R. A p value is therefore not provided, because even
  24. very small, meaningless effects will become significant with a large
  25. number of cells. Instead it is recommended to judge by the estimator b,
  26. the amount of variance explained (R squared for a given variable) and
  27. the gain in AIC (AIC without a given variable minus AIC global must be
  28. positive) whether the inclusion of a given explaining variable in the
  29. model is justified.
  30. <h4>The global model</h4>
  31. The <em>b</em> coefficients (b0 is offset), R squared or coefficient of
  32. determination (Rsq) and F are identical to the ones obtained from
  33. R-stats's lm() function and R-stats's anova() function. The AIC value
  34. is identical to the one obtained from R-stats's stepAIC() function
  35. (in case of backwards stepping, identical to the Start value). The
  36. AIC value corrected for the number of explaining variables and the BIC
  37. (Bayesian Information Criterion) value follow the logic of AIC.
  38. <h4>The explaining variables</h4>
  39. R squared for each explaining variable represents the additional amount
  40. of explained variance when including this variable compared to when
  41. excluding this variable, that is, this amount of variance is explained
  42. by the current explaining variable after taking into consideration all
  43. the other explaining variables.
  44. <p>
  45. The F score for each explaining variable allows testing if the inclusion
  46. of this variable significantly increases the explaining power of the
  47. model, relative to the global model excluding this explaining variable.
  48. That means that the F value for a given explaining variable is only
  49. identical to the F value of the R-function <em>summary.aov</em> if the
  50. given explaining variable is the last variable in the R-formula. While
  51. R successively includes one variable after another in the order
  52. specified by the formula and at each step calculates the F value
  53. expressing the gain by including the current variable in addition to the
  54. previous variables, <em>r.regression.multi</em> calculates the F-value
  55. expressing the gain by including the current variable in addition to all
  56. other variables, not only the previous variables.
  57. <p>
  58. The AIC value is identical to the one obtained from the R-function
  59. stepAIC() when excluding this variable from the full model. The AIC
  60. value corrected for the number of explaining variables and the BIC value
  61. (Bayesian Information Criterion) value follow the logic of AIC. BIC is
  62. identical to the R-function stepAIC with k = log(n). AICc is not
  63. available through the R-function stepAIC.
  64. <h2>EXAMPLE</h2>
  65. <!-- replace with better example -->
  66. Multiple regression with soil K-factor and elevation, aspect, and slope
  67. (North Carolina dataset). Output maps are the residuals and estimates:
  68. <div class="code"><pre>
  69. g.region raster=soils_Kfactor -p
  70. r.regression.multi mapx=elevation,aspect,slope mapy=soils_Kfactor \
  71. residuals=soils_Kfactor.resid estimates=soils_Kfactor.estim
  72. </pre></div>
  73. <h2>SEE ALSO</h2>
  74. <em>
  75. <a href="d.correlate.html">d.correlate</a>,
  76. <a href="r.regression.line.html">r.regression.line</a>,
  77. <a href="r.stats.html">r.stats</a>
  78. </em>
  79. <h2>AUTHOR</h2>
  80. Markus Metz
  81. <p><i>Last changed: $Date$</i>