1

I'm trying to find in QGIS an analogous tool to ArcGIS's "Ordinary Least Squares". The tool takes in a shapefile, where the dependent variable and independent variables are all fields in the same shapefile. The tool runs OLS and returns a shapefile with the same features as the original, with fields for fitted values and residuals. The SAGA tools in QGIS are not very intuitive nor well-documented, but from what I can decipher none of them seems to work like the "Ordinary Least Squares" tool in ArcGIS. To be clear, I want to run a regression where none of the data is in grid/raster format.

1 Answer 1

3

have you tried this one? Multiple Linear Regression(Shapes).

http://www.saga-gis.org/saga_tool_doc/7.8.0/statistics_regression_12.html

Interestingly the documentation refers to something called Trend Analysis (Shapes) which looks quite suitable, but i can't find it in QGIS - so it may have been deprecated or renamed? http://www.saga-gis.org/saga_tool_doc/7.8.0/statistics_regression_10.html

might be im looking at an older version (7.8.0) ill have another look for newer items.

3
  • I did look at "Multiple Linear Regression (Shapes)" and it seems the tools is not correctly configured. While the SAGA wiki says the tool should let me specify the dependent variable and predictors as a table field and parameters, respectively, the tool in QGIS 3.10 is requesting a layer instead of a table field for the dependent variable, and there is no place for the predictors. saga-gis.org/saga_tool_doc/7.8.0/statistics_regression_13.html
    – Gordon
    Commented Oct 19, 2020 at 14:18
  • When you run the tool, in the Log, it provides a summary, as an example Parameters Shapes: TABLE Results: Results Dependent Variable: fid Predictors: 2 parameters Details: Coefficients: <not set> Details: Model: <not set> Details: Steps: <not set> Method: stepwise Significance Level: 5.000000 Cross Validation: none The Predictors are the Coefficients/Model/Steps parameters im pretty sure.
    – nr_aus
    Commented Oct 20, 2020 at 1:24
  • Let's say I have features with attributes y, x1 and x2. I want to run a regression of y (dependent var) on x1 & x2 (independent vars, which I guess QGIS calls predictors). Do I need to have two separate shapefiles, one with the features having the y field and another with the features having the x1 and x2 fields? That's what I'm trying, since if I have the fields in one shapefile (as I would in ArcGIS) there's no way to tell the tool which field is the dependent variable and which is/are the predictor(s). Is my setup correct? It's giving an error "No predictors in selection" in the log.
    – Gordon
    Commented Oct 23, 2020 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.