r.regression.multi(1grass)
π r.regression.multi β the GRASS User's Manual page, but make it make sense π
okay bestie, sit down, hydrate, because we're doing multiple linear regression on raster maps and honestly? it's giving main character energy. this is r.regression.multi, a GRASS module, and it's lowkey a whole vibe.
Keywords: raster, statistics, regression π
β¨ SYNOPSIS β¨
r.regression.multi
r.regression.multi --help
r.regression.multi [-g] mapx=name[,name,...] mapy=name [residuals=name]
[estimates=name] [output=name] format=name [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π Flags
-gβ prints stuff in shell script style. BUT. bestie. π¨ this one is deprecated and it's getting removed in a future release. it's literally being retired. useformat=shellinstead, no cap.--overwriteβ lets output files overwrite files that already exist. use with intention, not on autopilot π--helpβ prints the usage summary so you can stop guessing, king.--verboseβ verbose module output (the module tells you everything, like a bestie who just got home from a date).--quietβ quiet module output (the module goes silent mode, mysterious, unbothered).--uiβ forces the GUI dialog to launch. graphic design is her passion. π¨
π¦ Parameters
mapx=name[,name,...][required] β the map(s) for the x coefficient. this is your explaining variables squad, comma-separated. π«Άmapy=name[required] β the map for the y coefficient. your beloved dependent variable, the one everybody else is explaining.residuals=nameβ a map to store the residuals in. the leftovers. the unexplained. πestimates=nameβ a map to store the estimates in.output=nameβ an ASCII file for storing the regression coefficients. (if you don't hand it a file, it just prints to your screen, which is honestly fine.)format=name[required] β the output format, and you MUST pick one.- Options:
shell,json - Default:
shell shellβ shell script style text outputjsonβ JSON (JavaScript Object Notation), for when you need your numbers in fancy braces
- Options:
π DESCRIPTION π
so r.regression.multi calculates a multiple linear regression from raster maps, following this formula:
Y = b0 + sum(bi*Xi) + E
where:
X = {X1, X2, ..., Xm}
m = number of explaining variables
Y = {y1, y2, ..., yn}
Xi = {xi1, xi2, ..., xin}
E = {e1, e2, ..., en}
n = number of observations (cases)
In R notation:
Y ~ sum(bi*Xi)
b0 is the intercept, and X0 is set to 1. iconic behaviour tbh.
now, the tea β: r.regression.multi is designed for large datasets that can not be processed in R. and because of that, a p value is NOT provided, because even very small, meaningless effects will become significant with a large number of cells. like, gorl, everything looks significant at that scale. so instead, it is recommended that you judge by:
- the estimator
b - the amount of variance explained (R squared for a given variable)
- the gain in AIC (AIC without a given variable minus AIC global must be positive)
...whether the inclusion of a given explaining variable in the model is justified. basically: vibe check your variables before you commit to them π
π The global model
the b coefficients (b0 is offset), R squared or coefficient of determination (Rsq) and F are identical to the ones you'd get from R-stats's lm() function and R-stats's anova() function. like, literally identical, fr fr.
the AIC value is identical to the one obtained from R-stats's stepAIC() function (and in case of backwards stepping, identical to the Start value).
the AIC value corrected for the number of explaining variables and the BIC (Bayesian Information Criterion) value follow the logic of AIC.
πΈ The explaining variables
R squared for each explaining variable represents the additional amount of explained variance when including this variable compared to when excluding it. that is, this amount of variance is explained by the current explaining variable after taking into consideration all the other explaining variables. she's being judged on her own merit, not on the group project. π
the F score for each explaining variable lets you test if the inclusion of this variable significantly increases the explaining power of the model, relative to the global model excluding this explaining variable.
that means the F value for a given explaining variable is only identical to the F value of the R-function summary.aov if the given explaining variable is the last variable in the R-formula. π¨
here's why: while R successively includes one variable after another in the order specified by the formula and at each step calculates the F value expressing the gain by including the current variable in addition to the previous variables, r.regression.multi calculates the F-value expressing the gain by including the current variable in addition to all other variables, not only the previous variables. different energy, same math family. β¨
the AIC value is identical to the one obtained from the R-function stepAIC() when excluding this variable from the full model.
the AIC value corrected for the number of explaining variables and the BIC (Bayesian Information Criterion) value follow the logic of AIC.
BIC is identical to the R-function stepAIC with k = log(n).
AICc is not available through the R-function stepAIC. π (not me telling you that, i'm just saying, it's not there.)
π EXAMPLE π
multiple regression with soil K-factor and elevation, aspect, and slope (North Carolina dataset). the output maps are the residuals and estimates, because we're thorough like that:
g.region raster=soils_Kfactor -p
r.regression.multi mapx=elevation,aspect,slope mapy=soils_Kfactor \
residuals=soils_Kfactor.resid estimates=soils_Kfactor.estim
look at her go π«Ά
π₯ SEE ALSO π₯
d.correlater.regression.liner.stats
π§ AUTHOR π§
Markus Metz β thank you for your service, king π
β SOURCE CODE β
Available at: r.regression.multi source code (history)
Latest change: Saturday Oct 11 04:38:40 2025 in commit: 3dd71f5fab83b72a2db2da959fe075c5b3b52200
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
and that's the whole page, bestie!! π this was r.regression.multi(1grass) from GRASS 8.5.0 β go run a regression, judge your variables kindly, and remember: AIC without a given variable minus AIC global must be positive. periodt. π
β¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms