Spatial Analysis of Primary School Final Exam Results in Warsaw

Parol, Pola (University of Warsaw, Faculty of Economic Sciences) , Zimovska, Irena (University of Warsaw, Faculty of Economic Sciences)
2024-06-29

Introduction

This project aims to analyze the determinants of school performance, specifically focusing on the final exam scores of primary schools in Warsaw. The examination is held at the eight grade. Exams are compulsory for Math, Polish and chosen foreign language. The dependent variable in this study is the average final exam scores for each school. The primary objective is to explore the spatial distribution of school performance and verify whether and how examined factors may influence these outcomes.

As the potential explanatories of the everage exams grade we consider:

Additionally, we incorporate the administrative districts of Warsaw to account for potential spatial heterogeneity.

Spatial econometrics offers a robust framework for modeling and understanding spatial dependencies and geographical variations in data. By leveraging spatial econometric techniques, this study will not only consider the direct effects of school-level characteristics on exam performance but also capture the spatial spillover effects that may arise from neighboring schools or districts. The analysis will employ spatial regression models to quantify the impact of different factors on school performance. These models will help us understand how variables such as school type, participation in extracurricular programs, and student demographics contribute to academic outcomes, while also accounting for the spatial structure of the data.

Analysis

Dataset description

The dataset contains information for primary schools in Warsaw from various sources. The average exam results per school, along with other statistics, are sourced from the Warsaw Regional Examination Board (https://oke.waw.pl). This database also provides information on whether a school is public or private. Using the given school addresses, the coordinates of each school were obtained, which are necessary for spatial models. Additionally, the dataset includes the number of students who took part in the exams for a particular year.

To enhance the analysis, the dataset includes a feature indicating whether students participated in a chess program. Information about participation in the chess program was sourced from the Warsaw City Hall. The chess program, ‘Wars and Sawa’, is part of the national chess initiative “Education through Chess at School”. This program is gaining popularity as chess is increasingly recognized as an effective and interesting educational tool.

Data Loading

Table 1: Table 2: Dataset envolved in modeling
lp Street lat long Result_Pol Result_Math Result_Eng Result_AVG Students School_name Public Chess_program District
1 Przasnyska 52.26476 20.96448 76.27891 74.42177 85.37500 78.69189 147 SZKOŁA PODSTAWOWA NR 92 IM. JANA BRZECHWY Tak 0 Żoliborz
2 Konarskiego 52.24030 20.91815 77.37853 77.51412 85.47253 80.12173 177 SZKOŁA PODSTAWOWA Z ODDZIAŁAMI INTEGRACYJNYMI NR 82 IM. JANA PAWŁA II Tak 1 Bemowo
3 Stanisława Szobera 52.23600 20.90058 72.30469 66.81250 78.86861 72.66193 128 SZKOŁA PODSTAWOWA NR 316 IM. ASTRID LINDGREN Tak 1 Bemowo
4 gen. Wiktora Thomméego 52.26093 20.90260 79.77358 76.79245 87.87850 81.48151 106 SZKOŁA PODSTAWOWA NR 150 IM. WALEREGO WRÓBLEWSKIEGO Tak 1 Bemowo
5 Tkaczy 52.22302 20.90632 79.18293 78.82927 83.16092 80.39104 82 SZKOŁA PODSTAWOWA NR 306 IM. KS. JANA TWARDOWSKIEGO Tak 0 Bemowo
6 Oławska 52.25919 20.92551 74.37989 77.29609 86.87912 79.51837 179 SZKOŁA PODSTAWOWA Z ODDZIAŁAMI INTEGRACYJNYMI NR 341 IM. TWÓRCÓW LITERATURY DZIECIĘCEJ Tak 0 Bemowo

Data Summary

Let’s start with an explanatory analysis of the dataset to understand its basic structure and key characteristics. The dataset consists of several variables, each providing valuable information about the schools and their exam results. The unique identifier “lp” ranges from 1 to 354, and “Street” gives the address of each school. The geographic coordinates (“lat” and “long”) indicate the exact school location in Warsaw. Exam results for Polish, Math, and English show a wide range of scores, with average results indicating varying levels of performance across schools. The number of students per school varies significantly, with a median of 53 and a mean of 64.37. The dataset includes more public schools (241) than private ones (113), and a small proportion of schools offer a chess program (77 out of 354). The schools are spread across various districts, with Mokotów having the highest representation.

       lp            Street               lat             long      
 Min.   :  1.00   Length:354         Min.   :52.11   Min.   :20.85  
 1st Qu.: 89.25   Class :character   1st Qu.:52.19   1st Qu.:20.97  
 Median :177.50   Mode  :character   Median :52.23   Median :21.03  
 Mean   :177.50                      Mean   :52.23   Mean   :21.03  
 3rd Qu.:265.75                      3rd Qu.:52.26   3rd Qu.:21.07  
 Max.   :354.00                      Max.   :52.36   Max.   :21.24  
                                                                    
   Result_Pol     Result_Math      Result_Eng      Result_AVG   
 Min.   :19.83   Min.   :18.00   Min.   :18.08   Min.   :23.06  
 1st Qu.:69.60   1st Qu.:59.50   1st Qu.:75.92   1st Qu.:68.56  
 Median :74.50   Median :68.78   Median :82.87   Median :75.29  
 Mean   :72.78   Mean   :67.26   Mean   :81.17   Mean   :73.68  
 3rd Qu.:78.06   3rd Qu.:77.07   3rd Qu.:90.35   3rd Qu.:81.42  
 Max.   :90.94   Max.   :96.40   Max.   :99.13   Max.   :94.34  
 NA's   :10      NA's   :9       NA's   :9       NA's   :8      
    Students       School_name        Public  Chess_program   
 Min.   :   1.00   Length:354         0:113   Min.   :0.0000  
 1st Qu.:  24.00   Class :character   1:241   1st Qu.:0.0000  
 Median :  53.00   Mode  :character           Median :0.0000  
 Mean   :  64.37                              Mean   :0.2175  
 3rd Qu.:  85.00                              3rd Qu.:0.0000  
 Max.   :1218.00                              Max.   :1.0000  
                                                              
           District  
 Mokotów       : 47  
 Ursynów       : 32  
 Wola          : 31  
 Praga-Południe: 29  
 Bielany       : 25  
 Wawer         : 25  
 (Other)       :165  

School Grouping

Next, the group_by method was employed to analyze the data and uncover interesting relationships. By grouping the data according to various categorical variables, such as school type (public or private), district, and participation in the chess program, we were able to calculate summary statistics and gain insights into the patterns and trends within the dataset. This approach allowed us to observe how different factors might influence the average exam results. For instance, we could compare the performance of schools that participated in the chess program with those that did not, or analyze the results across different districts of Warsaw. Grouping the data in this way provided a structured and organized means to investigate potential correlations and disparities, thereby enhancing our understanding of the underlying factors affecting school performance.

Below we present the visualisations of exam results related to each of the factor examined:

District

The boxplot provides a detailed visualization of the distribution of average exam results across various districts in Warsaw. Several key observations can be drawn from this analysis. Exam results across all districts range from approximately 20 to 100. However, most districts have the majority of their scores between 60 and 80. Some districts, including Praga-Północ and Rembertów, exhibit lower minimum values, indicating that a number of students are significantly underperforming. A comparative analysis reveals that some districts consistently perform better than others. For instance, Ursynów and Bemowo not only have higher median scores but also more compact distributions, suggesting the presence of effective educational resources or support systems in these areas.

Districts such as Ursynów and Bemowo exhibit relatively higher median exam results. This suggests that students in these districts generally perform better compared to those in other districts. Conversely, districts like Praga-Północ and Rembertów have lower median results, indicating that students in these areas tend to score lower on average. There is notable variability in exam results within several districts. For example, Mokotów and Wawer display a wide interquartile range (IQR), indicating a significant spread in student performance within these districts. In contrast, districts such as Ursynów and Bemowo have a narrower IQR, suggesting more consistent performance among students in these areas.

Several districts feature outliers, as represented by dots outside the whiskers. Districts such as Bielany, Ochota, and Praga-Północ have noticeable outliers, which may represent students with exceptionally low or high scores. These outliers warrant further investigation to understand the factors contributing to these extreme values.

Public vs Private

The plot provides a clear visual comparison between the distributions of exam results in public schools (Public = 1) and private schools (Public = 0). Both distributions are somewhat symmetrical, suggesting a similar spread of data points on either side of the median. Private schools (represented by “0”) tend to have a slightly higher median exam result compared to public schools (represented by “1”). The interquartile ranges (IQRs) for both public and private schools are fairly wide, indicating variability in exam results within each category. Private schools exhibit a higher peak density around the upper quartile, suggesting a concentration of students achieving higher exam results. While public schools have a more pronounced density at lower exam results compared to private schools, indicating a higher number of students with lower scores.

Chess program

The violin plot demonstrates the distribution of average exam results categorized by participation in the chess program. Notably, schools that do not participate in the chess program display a broader range of exam results, indicating higher variability. The central tendency for these schools skews towards the 75-80 range. Conversely, schools involved in the chess program exhibit a more concentrated distribution, predominantly within the 75-85 range, suggesting less variability and potentially higher overall performance. The mean exam results for chess program participants are marginally higher, indicating that the chess program might contribute positively to academic performance. Both groups have outliers, showing that some schools perform significantly lower regardless of program participation.

Districts & chess program

Chess program - math results

# A tibble: 2 × 2
  Chess_program Avg_Result
  <fct>              <dbl>
1 0                   67.7
2 1                   65.8

Mapping School Locations

Additionally, the data can be mapped to visualize the locations of the schools. By plotting the coordinates of each school on a map, we can gain spatial insights into the distribution of schools across different districts of Warsaw. This geographic representation helps to identify any spatial patterns or clusters that may exist, providing a visual context to the numerical data.

Mapping the schools allows us to see if there are any geographic trends in exam performance, such as whether certain areas have consistently higher or lower results. This not only enhances the analysis but also makes it easier to communicate findings to a broader audience, highlighting the spatial dimension of educational outcomes.

Schools Location

All the schools are located in the Warsaw City Region. At the first glance, it can be observed that schools are distributed rather evenly, with the higher number in the middle part of the city. There is also the visible border between the left and the right hand side - the Vistula River.

Map with all schools

Public vs Private

Exam Results

Chess Program at schools

District

Clustering

In clustering analysis, determining the optimal number of clusters is a crucial step. The choice of the number of clusters significantly impacts the insights that can be derived from the data. Different methods can be employed to identify the most appropriate number of clusters, ensuring that the data is well-partitioned and that the clusters are meaningful. Three commonly used methods to determine the optimal number of clusters are the Elbow Method, the Silhouette Method, and the Gap Statistic Method. To determine the optimal number of clusters for our dataset, we applied all three aforementioned methods. Each method provides valuable insights, and comparing their results helps in making an informed decision about the most suitable number of clusters for our data. By combining the results from the Elbow Method, Silhouette Method, and Gap Statistic Method, we ensure a robust and comprehensive clustering analysis.

Elbow Method

The Elbow Method involves plotting the within-cluster sum of squares (WSS) against the number of clusters. The WSS measures the compactness of the clusters, with lower values indicating more compact clusters. The optimal number of clusters is identified at the “elbow point,” where the rate of decrease in WSS slows down significantly. This point represents a balance between the number of clusters and the compactness of the clusters.

Silhouette

The Silhouette Method evaluates the quality of clustering by calculating the average silhouette width for different numbers of clusters. The silhouette width measures how similar each data point is to its own cluster compared to other clusters. Higher silhouette widths indicate better-defined clusters. The optimal number of clusters is chosen based on the highest average silhouette width, indicating the best separation between clusters.

Gap Statistics

The Gap Statistic Method compares the total within intra-cluster variation for different numbers of clusters with their expected values under null reference distribution of the data. This method calculates the gap statistic for each number of clusters, which measures the difference between the observed WSS and the expected WSS under a random uniform distribution. The optimal number of clusters is identified as the one that maximizes the gap statistic.

Clusters mapping

Spatial Modelling

Moran Test

The Moran’s I test is a pivotal measure in the field of spatial statistics, employed to evaluate the degree of spatial autocorrelation within a dataset. Spatial autocorrelation refers to the correlation of a variable with itself across space, offering insights into whether similar values exhibit clustering, dispersion, or randomness in their spatial distribution. The primary objective of Moran’s I is to quantify spatial autocorrelation, thereby elucidating whether the observed spatial patterns are due to random processes or exhibit statistically significant clustering or dispersion. Moran’s I is calculated using the values of the variable of interest and the spatial weighs matrix. The formula for Moran’s I incorporates the product of deviations from the mean for paired observations, weighted by their spatial relationships. The value of Moran’s I ranges from -1 to 1. Values near 1 indicate strong positive spatial autocorrelation, signifying that similar values are spatially clustered. Values near -1 indicate strong negative spatial autocorrelation, suggesting that similar values touch less often than random. Values around 0 imply no spatial autocorrelation, indicating a random spatial distribution. A p-value less than 0.05 typically denotes that the observed spatial pattern is statistically significant and not attributable to random chance.

The formula for Moran’s I is:

\[ I = \frac{N}{W} \frac{\sum_{i=1}^N \sum_{j=1}^N w_{ij} (x_i - \bar{x})(x_j - \bar{x})}{\sum_{i=1}^N (x_i - \bar{x})^2} \]

where:

The result of the Moran’s I test suggests that there is no statistically significant spatial autocorrelation in the average exam results (Result_AVG) of the schools. The Moran’s I value of 0.0317 is very close to zero, indicating very weak positive spatial autocorrelation, and the p-value of 0.1372 suggests that this observed value could likely be due to random chance. Thus, we do not have sufficient evidence to conclude that the average exam results exhibit significant spatial clustering. Despite the lack of statistically significant spatial autocorrelation, further analysis will be conducted. This will help ensure that any potential patterns or insights that might not be apparent through Moran’s I test alone can still be identified and examined in more detail.


    Moran I test under randomisation

data:  df_sf$Result_AVG  
weights: lw    

Moran I statistic standard deviate = 1.0928, p-value = 0.1372
alternative hypothesis: greater
sample estimates:
Moran I statistic       Expectation          Variance 
      0.031739848      -0.002923977       0.001006086 

Linear Regression

As a first step, we approach the data with estimating OLS regression. As mentioned above, as potential predictors we consider the number of students at school, the district where the school is located, whether the school is public or private and whether it participates in the chess program or not.

The adjusted R-squared is 0.1833. The variables are statistically significant jointly, yet in particular some are not. First, the statistically significant difference in exam results is observed due to the school status: indeed, private schools have lower results (so, the coefficient is negative). The number of students has quite low beta, near zero, so probably it does not appear to be impactful. Across the districts, the comparing to Bemowo, other districts have lower average scores. The statistically significant results among those yet are for Bielany, Mokotów, Ochota, Praga-Północ, Rembertów, Targówek and Wola (holding 10% confidence level).

Characteristic Beta 95% CI1 p-value
Students 0.01 -0.01, 0.03 0.2
Public


    0
    1 -11 -14, -8.4 <0.001
Chess_program


    0
    1 1.3 -1.7, 4.3 0.4
District


    Bemowo
    Białołęka -1.9 -9.1, 5.4 0.6
    Bielany -8.2 -15, -1.1 0.024
    Mokotów -5.2 -12, 1.3 0.12
    Ochota -9.4 -18, -1.0 0.028
    Praga-Północ -11 -20, -2.4 0.013
    Praga-Południe -5.7 -13, 1.3 0.11
    Rembertów -11 -20, -1.3 0.026
    Śródmieście -4.4 -12, 2.9 0.2
    Targówek -8.5 -16, -1.1 0.024
    Ursus -2.9 -11, 5.6 0.5
    Ursynów -0.42 -7.3, 6.5 >0.9
    Wawer -5.5 -13, 1.8 0.14
    Wesoła -6.3 -15, 2.3 0.2
    Wilanów -4.4 -12, 3.7 0.3
    Włochy -6.1 -15, 2.3 0.2
    Wola -7.0 -14, 0.06 0.052
    Żoliborz -0.67 -10, 8.8 0.9
1 CI = Confidence Interval

Expanding the standard approach, we also attempt to estimate spatial econometric models, which allow to catch any statistical dependens in spatial lags for:

SAR (Spatial Lag Model)

The Spatial Lag model examines the spatial dependence in the lags for the dependent variable only.

Characteristic Beta 95% CI1 p-value
rho -0.07 -0.22, 0.09 0.4
(Intercept) 91 77, 104 <0.001
Students 0.01 0.00, 0.03 0.2
Public1 -11 -14, -8.4 <0.001
Chess_program1 1.4 -1.5, 4.3 0.4
DistrictBiałołęka -1.8 -8.7, 5.2 0.6
DistrictBielany -8.2 -15, -1.4 0.019
DistrictMokotów -5.4 -12, 0.96 0.10
DistrictOchota -9.7 -18, -1.5 0.020
DistrictPraga-Północ -12 -21, -3.3 0.007
DistrictPraga-Południe -5.8 -13, 0.97 0.093
DistrictRembertów -11 -20, -1.8 0.019
DistrictŚródmieście -4.4 -11, 2.6 0.2
DistrictTargówek -8.9 -16, -1.7 0.016
DistrictUrsus -2.8 -11, 5.4 0.5
DistrictUrsynów -0.08 -6.7, 6.6 >0.9
DistrictWawer -5.6 -13, 1.4 0.12
DistrictWesoła -6.3 -15, 2.0 0.14
DistrictWilanów -4.2 -12, 3.6 0.3
DistrictWłochy -6.0 -14, 2.2 0.2
DistrictWola -7.3 -14, -0.46 0.036
DistrictŻoliborz -0.61 -9.7, 8.5 0.9
1 CI = Confidence Interval

Rho (ρ): Indicates a slight negative spatial dependence, but the effect is minimal. The coefficient is also not statistically significant.

If it would be, we would assume that a random shock (change) in exam results in location i does not only affect the exam results in this area, but also impacts the outcomes in the neighbourhoods.

The coefficients for the districts are preserved to be negative.

                   rho            (Intercept)               Students 
           -0.06599890            90.68512099             0.01024610 
               Public1         Chess_program1      DistrictBiałołęka 
          -11.08600325             1.37556473            -1.75841434 
       DistrictBielany        DistrictMokotów         DistrictOchota 
           -8.24775059            -5.40128944            -9.69297082 
  DistrictPraga-Północ DistrictPraga-Południe      DistrictRembertów 
          -11.90758269            -5.80448276           -11.02086278 
   DistrictŚródmieście       DistrictTargówek          DistrictUrsus 
           -4.39484218            -8.92623896            -2.81439834 
       DistrictUrsynów          DistrictWawer         DistrictWesoła 
           -0.07913551            -5.58876193            -6.28193387 
       DistrictWilanów         DistrictWłochy           DistrictWola 
           -4.20572485            -5.95206556            -7.29907557 
      DistrictŻoliborz 
           -0.61489773 

SEM (Spatial Error Model)

Characteristic Beta 95% CI1 p-value
(Intercept) 85 80, 91 <0.001
Students 0.01 0.00, 0.03 0.2
Public1 -11 -14, -8.5 <0.001
Chess_program1 1.5 -1.4, 4.4 0.3
DistrictBiałołęka -1.5 -7.9, 4.8 0.6
DistrictBielany -7.8 -14, -1.6 0.014
DistrictMokotów -5.1 -11, 0.69 0.084
DistrictOchota -9.1 -17, -1.7 0.016
DistrictPraga-Północ -12 -19, -3.8 0.003
DistrictPraga-Południe -5.1 -11, 1.0 0.10
DistrictRembertów -10 -18, -1.8 0.017
DistrictŚródmieście -4.1 -10, 2.3 0.2
DistrictTargówek -8.2 -15, -1.8 0.013
DistrictUrsus -2.4 -9.9, 5.0 0.5
DistrictUrsynów -0.13 -6.1, 5.9 >0.9
DistrictWawer -5.3 -12, 0.98 0.10
DistrictWesoła -5.8 -13, 1.7 0.13
DistrictWilanów -4.1 -11, 2.9 0.3
DistrictWłochy -5.5 -13, 2.0 0.15
DistrictWola -6.8 -13, -0.64 0.030
DistrictŻoliborz -0.28 -8.6, 8.0 >0.9
lambda -0.11 -0.28, 0.06 0.2
1 CI = Confidence Interval

Lambda (λ): Indicates slight negative spatial autocorrelation in the error terms, suggesting that unexplained variations in exam scores are slightly negatively correlated among neighboring schools.

                lambda            (Intercept)               Students 
           -0.10970251            85.44309639             0.01066929 
               Public1         Chess_program1      DistrictBiałołęka 
          -11.18091256             1.52992740            -1.52627876 
       DistrictBielany        DistrictMokotów         DistrictOchota 
           -7.75657108            -5.05915442            -9.12236023 
  DistrictPraga-Północ DistrictPraga-Południe      DistrictRembertów 
          -11.54580464            -5.08422524           -10.11517791 
   DistrictŚródmieście       DistrictTargówek          DistrictUrsus 
           -4.07862535            -8.22281620            -2.41582971 
       DistrictUrsynów          DistrictWawer         DistrictWesoła 
           -0.12942602            -5.34050886            -5.79302491 
       DistrictWilanów         DistrictWłochy           DistrictWola 
           -4.13816883            -5.50053451            -6.78723113 
      DistrictŻoliborz 
           -0.27958464 

SDM (Spatial Durbin Model )

As for the SDM model, it also verifies the significance of spatial dependence with the lags of the explanatories.

Characteristic Beta 95% CI1 p-value
rho -0.11 -0.28, 0.05 0.2
(Intercept) 94 78, 111 <0.001
Public1 -11 -14, -8.5 <0.001
Chess_program1 2.2 -0.70, 5.1 0.14
Students 0.01 -0.01, 0.02 0.3
DistrictBiałołęka -14 -60, 32 0.5
DistrictBielany -22 -51, 6.6 0.13
DistrictMokotów -18 -53, 17 0.3
DistrictOchota -17 -47, 13 0.3
DistrictPraga-Północ -5.7 -43, 32 0.8
DistrictPraga-Południe -34 -71, 3.2 0.073
DistrictRembertów -39 -85, 6.9 0.10
DistrictŚródmieście -8.3 -38, 21 0.6
DistrictTargówek -22 -66, 21 0.3
DistrictUrsus -28 -68, 12 0.2
DistrictUrsynów -18 -60, 24 0.4
DistrictWawer -29 -71, 13 0.2
DistrictWesoła -21 -76, 35 0.5
DistrictWilanów -20 -63, 23 0.4
DistrictWłochy -22 -54, 9.6 0.2
DistrictWola -4.6 -34, 25 0.8
DistrictŻoliborz -26 -59, 7.8 0.13
lag.Public1 -4.0 -9.9, 2.0 0.2
lag.Chess_program1 5.7 -1.2, 13 0.10
lag.Students 0.01 -0.01, 0.04 0.3
lag.DistrictBiałołęka 12 -35, 60 0.6
lag.DistrictBielany 13 -17, 43 0.4
lag.DistrictMokotów 14 -22, 49 0.5
lag.DistrictOchota 7.9 -23, 39 0.6
lag.DistrictPraga-Północ -10 -49, 28 0.6
lag.DistrictPraga-Południe 30 -7.2, 68 0.11
lag.DistrictRembertów 30 -17, 78 0.2
lag.DistrictŚródmieście 3.7 -27, 34 0.8
lag.DistrictTargówek 15 -30, 59 0.5
lag.DistrictUrsus 27 -13, 68 0.2
lag.DistrictUrsynów 18 -25, 61 0.4
lag.DistrictWawer 22 -20, 65 0.3
lag.DistrictWesoła 14 -43, 71 0.6
lag.DistrictWilanów 16 -27, 59 0.5
lag.DistrictWłochy 18 -18, 55 0.3
lag.DistrictWola -2.1 -32, 28 0.9
lag.DistrictŻoliborz 29 -6.4, 65 0.11
1 CI = Confidence Interval
                       rho                (Intercept) 
              -0.114226353               94.431011381 
                   Public1             Chess_program1 
             -11.193553850                2.182048448 
                  Students          DistrictBiałołęka 
               0.008077953              -14.086123318 
           DistrictBielany            DistrictMokotów 
             -22.144859414              -18.336737034 
            DistrictOchota       DistrictPraga-Północ 
             -16.971482823               -5.734797900 
    DistrictPraga-Południe          DistrictRembertów 
             -33.839518660              -39.020500450 
       DistrictŚródmieście           DistrictTargówek 
              -8.346140157              -22.488735498 
             DistrictUrsus            DistrictUrsynów 
             -28.170976967              -17.987536665 
             DistrictWawer             DistrictWesoła 
             -28.758782417              -20.510183254 
           DistrictWilanów             DistrictWłochy 
             -20.135856455              -22.305360521 
              DistrictWola           DistrictŻoliborz 
              -4.557394603              -25.520579213 
               lag.Public1         lag.Chess_program1 
              -3.980262396                5.668858250 
              lag.Students      lag.DistrictBiałołęka 
               0.014038893               12.375761900 
       lag.DistrictBielany        lag.DistrictMokotów 
              13.309989724               13.549468222 
        lag.DistrictOchota   lag.DistrictPraga-Północ 
               7.888009093              -10.162556992 
lag.DistrictPraga-Południe      lag.DistrictRembertów 
              30.410372622               30.114507883 
   lag.DistrictŚródmieście       lag.DistrictTargówek 
               3.677326011               14.589595933 
         lag.DistrictUrsus        lag.DistrictUrsynów 
              27.271562666               17.814808006 
         lag.DistrictWawer         lag.DistrictWesoła 
              22.326799214               14.092202231 
       lag.DistrictWilanów         lag.DistrictWłochy 
              15.918898324               18.370984061 
          lag.DistrictWola       lag.DistrictŻoliborz 
              -2.087001758               29.366511238 

SAC (Kelejian-Prucha Model)

This model type tests spatial lags of the dependent variable and error terms.

Characteristic Beta 95% CI1 p-value
rho 0.09 -0.31, 0.49 0.7
(Intercept) 79 47, 110 <0.001
Public1 -11 -14, -8.5 <0.001
Chess_program1 1.6 -1.3, 4.5 0.3
Students 0.01 0.00, 0.03 0.2
DistrictBiałołęka -1.4 -7.3, 4.4 0.6
DistrictBielany -7.3 -13, -1.3 0.018
DistrictMokotów -4.7 -10, 0.83 0.10
DistrictOchota -8.5 -16, -1.2 0.022
DistrictPraga-Północ -11 -19, -2.4 0.012
DistrictPraga-Południe -4.5 -10, 1.4 0.14
DistrictRembertów -9.3 -18, -0.81 0.032
DistrictŚródmieście -3.8 -9.9, 2.2 0.2
DistrictTargówek -7.5 -14, -0.77 0.029
DistrictUrsus -2.2 -9.1, 4.7 0.5
DistrictUrsynów -0.36 -6.0, 5.3 0.9
DistrictWawer -5.1 -11, 0.89 0.10
DistrictWesoła -5.4 -13, 1.7 0.14
DistrictWilanów -4.2 -11, 2.4 0.2
DistrictWłochy -5.3 -12, 1.8 0.14
DistrictWola -6.2 -12, 0.05 0.052
DistrictŻoliborz -0.11 -7.8, 7.6 >0.9
lambda -0.20 -0.68, 0.28 0.4
1 CI = Confidence Interval
                       rho                (Intercept) 
              -0.114226353               94.431011381 
                   Public1             Chess_program1 
             -11.193553850                2.182048448 
                  Students          DistrictBiałołęka 
               0.008077953              -14.086123318 
           DistrictBielany            DistrictMokotów 
             -22.144859414              -18.336737034 
            DistrictOchota       DistrictPraga-Północ 
             -16.971482823               -5.734797900 
    DistrictPraga-Południe          DistrictRembertów 
             -33.839518660              -39.020500450 
       DistrictŚródmieście           DistrictTargówek 
              -8.346140157              -22.488735498 
             DistrictUrsus            DistrictUrsynów 
             -28.170976967              -17.987536665 
             DistrictWawer             DistrictWesoła 
             -28.758782417              -20.510183254 
           DistrictWilanów             DistrictWłochy 
             -20.135856455              -22.305360521 
              DistrictWola           DistrictŻoliborz 
              -4.557394603              -25.520579213 
               lag.Public1         lag.Chess_program1 
              -3.980262396                5.668858250 
              lag.Students      lag.DistrictBiałołęka 
               0.014038893               12.375761900 
       lag.DistrictBielany        lag.DistrictMokotów 
              13.309989724               13.549468222 
        lag.DistrictOchota   lag.DistrictPraga-Północ 
               7.888009093              -10.162556992 
lag.DistrictPraga-Południe      lag.DistrictRembertów 
              30.410372622               30.114507883 
   lag.DistrictŚródmieście       lag.DistrictTargówek 
               3.677326011               14.589595933 
         lag.DistrictUrsus        lag.DistrictUrsynów 
              27.271562666               17.814808006 
         lag.DistrictWawer         lag.DistrictWesoła 
              22.326799214               14.092202231 
       lag.DistrictWilanów         lag.DistrictWłochy 
              15.918898324               18.370984061 
          lag.DistrictWola       lag.DistrictŻoliborz 
              -2.087001758               29.366511238 

Models Evaluation

In order to choose the most appropriate model, it is crucial to evaluate models using appropriate metrics such as AIC (Akaike Information Criterion), BIC (Bayesian Information Criterion), and Log-Likelihood. These metrics help balance the trade-off between model fit and complexity, ensuring that the chosen model is not only accurate but also efficient.

AIC & BIC

AIC (Akaike Information Criterion) and BIC (Bayesian Information Criterion) are widely used statistical measures for model selection. Both criteria assess the quality of a model by balancing the goodness of fit and the complexity of the model. AIC focuses on minimizing the information loss, while BIC incorporates a penalty for the number of parameters, thus more heavily penalizing complex models. Lower AIC or BIC values indicate a better model.

Based on the AIC and BIC values, the SEM (Spatial Error Model) has the lowest values (AIC: 2625.460, BIC: 2713.728), suggesting it is the preferred model among those evaluated. This indicates that the SEM provides a better balance between model fit and complexity compared to the SAR, SDM, and SAC models.

Table 3: Table 4: AIC & BIC for models
Model AIC BIC
SAR 2626.285 2714.553
SEM 2625.460 2713.728
SDM 2638.742 2803.765
SAC 2627.149 2719.255

Log-Likelihood

As for the goodness of fit, the models can be compared with the Log-Likelihood values. Higher Log-Likelihood values (closer to zero) represent better model fits. In this case, the SDM (Spatial Durbin Model) has the highest Log-Likelihood value (-1276.371), suggesting it fits the data better than the SAR, SEM, and SAC models.

Table 5: Table 6: Log-Likelihood for models
Model Log_Likelihood
SAR -1290.143
SEM -1289.730
SDM -1276.371
SAC -1289.575

Model Summary Table

Summing up, in this project we implemented spatial econometric models to test for spatial dependencies in the average 8th grade exam scores in Warsaw. Various combinations of lags were examined in the models (e.g. spillover effects only for the dependent variable vs for both y and error terms). Additionally, the Moran test was implemented to test for spatial autocorrelation in exam results.

As for statistically significant findings, we observed that the public schools demonstrate better student performances in exams. The number of students at schools did not affect the scores, same as the chess program participation.

Spatial spillover effects did not occur to be statistically significant, yet adding lags of the explanatories in the Spatial Durbin Model impacted the standard error terms for the district variables.


Regression Results
===================================================================================
                                             Dependent variable:                   
                           --------------------------------------------------------
                                                  Result_AVG                       
                                     OLS              SAR        SEM        SDM    
                                     (1)              (2)        (3)        (4)    
-----------------------------------------------------------------------------------
Students                            0.010            0.010      0.011      0.008   
                                   (0.008)          (0.008)    (0.008)    (0.008)  
                                                                                   
Public1                          -11.138***        -11.086*** -11.181*** -11.194***
                                   (1.412)          (1.367)    (1.368)    (1.354)  
                                                                                   
Chess_program1                      1.304            1.376      1.530      2.182   
                                   (1.534)          (1.485)    (1.488)    (1.471)  
                                                                                   
DistrictBiałołęka                 -1.880            -1.758     -1.526    -14.086  
                                   (3.684)          (3.566)    (3.228)    (23.544) 
                                                                                   
DistrictBielany                   -8.167**          -8.248**   -7.757**   -22.145  
                                   (3.602)          (3.505)    (3.162)    (14.657) 
                                                                                   
DistrictMokotów                    -5.229           -5.401*    -5.059*    -18.337  
                                   (3.339)          (3.245)    (2.932)    (17.814) 
                                                                                   
DistrictOchota                    -9.414**          -9.693**   -9.122**   -16.971  
                                   (4.267)          (4.156)    (3.772)    (15.309) 
                                                                                   
DistrictPraga-Północ             -11.206**        -11.908*** -11.546***   -5.735  
                                   (4.474)          (4.403)    (3.934)    (19.265) 
                                                                                   
DistrictPraga-Południe             -5.657           -5.804*     -5.084    -33.840* 
                                   (3.546)          (3.458)    (3.103)    (18.889) 
                                                                                   
DistrictRembertów                -10.693**        -11.021**  -10.115**   -39.021* 
                                   (4.785)          (4.683)    (4.222)    (23.452) 
                                                                                   
DistrictŚródmieście                -4.356            -4.395     -4.079     -8.346  
                                   (3.704)          (3.590)    (3.265)    (14.975) 
                                                                                   
DistrictTargówek                 -8.520**          -8.926**   -8.223**   -22.489  
                                   (3.763)          (3.694)    (3.296)    (22.332) 
                                                                                   
DistrictUrsus                      -2.936            -2.814     -2.416    -28.171  
                                   (4.352)          (4.214)    (3.809)    (20.340) 
                                                                                   
DistrictUrsynów                   -0.422            -0.079     -0.129    -17.988  
                                   (3.495)          (3.391)    (3.062)    (21.662) 
                                                                                   
DistrictWawer                      -5.452            -5.589    -5.341*    -28.759  
                                   (3.675)          (3.564)    (3.225)    (21.395) 
                                                                                   
DistrictWesoła                     -6.255            -6.282     -5.793    -20.510  
                                   (4.361)          (4.234)    (3.817)    (28.262) 
                                                                                   
DistrictWilanów                   -4.398            -4.206     -4.138    -20.136  
                                   (4.114)          (3.981)    (3.613)    (21.809) 
                                                                                   
DistrictWłochy                     -6.105            -5.952     -5.501    -22.305  
                                   (4.275)          (4.142)    (3.807)    (16.295) 
                                                                                   
DistrictWola                       -6.962*          -7.299**   -6.787**    -4.557  
                                   (3.568)          (3.489)    (3.136)    (14.990) 
                                                                                   
DistrictŻoliborz                   -0.669            -0.615     -0.280    -25.521  
                                   (4.788)          (4.633)    (4.227)    (17.015) 
                                                                                   
lag.Public1                                                                -3.980  
                                                                          (3.026)  
                                                                                   
lag.Chess_program1                                                         5.669   
                                                                          (3.486)  
                                                                                   
lag.Students                                                               0.014   
                                                                          (0.014)  
                                                                                   
lag.DistrictBiałołęka                                                     12.376  
                                                                          (24.130) 
                                                                                   
lag.DistrictBielany                                                        13.310  
                                                                          (15.289) 
                                                                                   
lag.DistrictMokotów                                                        13.549  
                                                                          (18.264) 
                                                                                   
lag.DistrictOchota                                                         7.888   
                                                                          (16.005) 
                                                                                   
lag.DistrictPraga-Północ                                                 -10.163  
                                                                          (19.612) 
                                                                                   
lag.DistrictPraga-Południe                                                 30.410  
                                                                          (19.165) 
                                                                                   
lag.DistrictRembertów                                                     30.115  
                                                                          (24.276) 
                                                                                   
lag.DistrictŚródmieście                                                    3.677   
                                                                          (15.584) 
                                                                                   
lag.DistrictTargówek                                                      14.590  
                                                                          (22.795) 
                                                                                   
lag.DistrictUrsus                                                          27.272  
                                                                          (20.591) 
                                                                                   
lag.DistrictUrsynów                                                       17.815  
                                                                          (21.935) 
                                                                                   
lag.DistrictWawer                                                          22.327  
                                                                          (21.757) 
                                                                                   
lag.DistrictWesoła                                                         14.092  
                                                                          (28.888) 
                                                                                   
lag.DistrictWilanów                                                       15.919  
                                                                          (22.151) 
                                                                                   
lag.DistrictWłochy                                                         18.371  
                                                                          (18.610) 
                                                                                   
lag.DistrictWola                                                           -2.087  
                                                                          (15.472) 
                                                                                   
lag.DistrictŻoliborz                                                       29.367  
                                                                          (18.239) 
                                                                                   
Constant                          85.773***        90.685***  85.443***  94.431*** 
                                   (3.145)          (6.817)    (2.803)    (8.320)  
                                                                                   
-----------------------------------------------------------------------------------
Observations                         343              343        343        343    
R2                                  0.236                                          
Adjusted R2                         0.188                                          
Log Likelihood                                     -1,290.143 -1,289.730 -1,276.371
sigma2                                              108.204    107.793     99.697  
Akaike Inf. Crit.                                  2,626.285  2,625.460  2,638.742 
Residual Std. Error           10.750 (df = 322)                                    
F Statistic                4.966*** (df = 20; 322)                                 
Wald Test (df = 1)                                   0.690      1.657      1.838   
LR Test (df = 1)                                     0.643      1.468      1.645   
===================================================================================
Note:                                                   *p<0.1; **p<0.05; ***p<0.01

Disclaimer on use of GenAI

The generative AI tools were adapted for enhancing the accuracy of the text and solving technical matters in formatting.