GWR (Geographically Weighted Regression)

GWR (Geographically Weighted Regression)

⚡ Advanced · Spatial Regression · Local Coefficients

v1.0.2

Education Sciences context — a regression in which the coefficients vary by location. At each point a local model is fitted with an AICc-optimal bandwidth; a map of β₁(s), β₂(s) is obtained.

mgwr · Sel_BWAICc-optimalLokal R²β min/Q25/medyan/Q75/max

🎯 What is it for?

Standard OLS estimates a single global β; GWR produces location-varying β, answering questions such as “Is the effect of X1 stronger in the north or the south?” For Education Sciences, it visualizes how the sensitivity of okul_basari_skoru to sosyoekonomik_indeks and ogretmen_orani varies regionally.

📌 When is it used?

  • Spatial clustering in the OLS residuals (Moran’s I significant)
  • The discipline-specific question “does the effect differ by geography?”
  • A desire to visualize spatial heterogeneity

⚙ Assumptions

  1. Lat/lon coordinates, continuous DV (okul_basari_skoru), continuous X’s.
  2. Sufficient density: number of points within the bandwidth ≥ 30.
  3. AICc / CV for bandwidth selection (default AICc).

📊 How to Run It in MerQur?

1
Load data (lat/lon + DV + X’s).
2
Analysis → ⚡ Advanced → GWR.
3

Panel assignments (form fields in the program):

  • Columns: {'y': 'birim_id', 'x': ['X1', 'X2'], 'lat': 'lat', 'lon': 'lon'}
  • Parameters: {'bandwidth_method': 'AICc'}
4
Bandwidth: adaptive Bisquare (default). AICc-optimal sel_bw.
5
▶ Run. Local R² scatter map + min/Q25/median/Q75/max for each coefficient + % significant table.

📊 Sample Dataset — Education Sciences

ℹ Note: The scenario, MerQur output and interpretation below were produced by actually running the real example dataset in MerQur. Numeric results on your own data will differ; the goal is to show how the analysis is set up and interpreted end-to-end.

🎬 Example File

This analysis is demonstrated on the following example dataset for Education Sciences:

Egitim_Bilimleri/107_gwr_local.xlsx

🎬 Scenario

Suppose we suspect that the effect of our predictors on an educational
outcome is not constant across a region but changes from place to place.
Across 110 spatial units we have coordinates lat and lon, two predictors X1
and X2, and the outcome Y_value. Geographically Weighted Regression is
appropriate because it fits a separate local regression around each
location, weighting nearby observations more heavily, so we can map how the
relationship between X1, X2 and Y_value varies geographically. This reveals
spatial non-stationarity that a single global model would hide.

⚙️ Variable Selection

  • Coordinates: lat, lon
  • Predictors: X1, X2
  • Dependent variable: Y_value

Data Preview (First 5 Rows)

unit_id lat lon X1 X2 Y_value
1.0 40.9141 38.4082 69.6 18.8 227.4
2.0 38.892 29.2114 39.1 25.4 401.3
3.0 39.2512 37.5754 24.9 34.1 495.9
4.0 40.24 39.2261 51.4 51.0 437.6
5.0 38.3041 29.6453 52.7 29.6 331.8

n = 110 · Columns: unit_id, lat, lon, X1, X2, Y_value

📈 MerQur Output

GWR (GEOGRAPHICALLY WEIGHTED REGRESSION) RESULT
─────────────────────────────────────────────

R2 = 0.887 (local/location-specific regression)
Spatial variation of the relationship

💬 Interpretation

Ordinary regression assumes a single relationship for the whole region; but this relationship can vary in space
— a variable’s effect may be strong in one region and weak in another. GWR (Geographically Weighted Regression)
captures this spatial heterogeneity by fitting a separate local regression at each location (R2 = 0.89). The
output is a map of coefficients: a surface showing where a variable’s effect is strong and where it is weak. This
tests “is the relationship the same everywhere” and sets local policy priorities. In education, GWR reveals what
the global model hides for mapping regional inequalities and intervention priorities.

⚠ Common Mistakes

  • If too few points fall within the bandwidth in low-density regions, the standard error becomes large.
  • If you find the same effect across the entire region, global OLS is sufficient — the complication of GWR is not needed.
  • Multicollinearity may vary locally in GWR; checking the VIF at each bandwidth is recommended.

📚 MerQur’a Atıf

Örücü, Ö. K. (2026). MerQur: Integrated Academic Data Analysis & Reporting Platform [Computer software] (Version 1.0.0). https://doi.org/10.53463/merqur.2026001

Tüm atıf formatları →

📝 Üretim Notu — Bu sayfadaki örnek veri sentetik olarak üretilmiştir (sabit SEED=42, generator: samples/Ileri_Duzey_v102/_generate_v102_datasets.py). Sayfa içeriği Anthropic Claude desteği ile hazırlanmış, akademik doğruluk yazar tarafından kontrol edilmiştir.