__STYLES__

Outlier Detection in Election Data Using Geospatial AnalysisCase Study: Ensuring Election Integrity

Outlier Detection in Election Data Using Geospatial AnalysisCase Study: Ensuring Election Integrity

About this project

Outlier scores were calculated using a geospatial analysis method that considers both the geographical location (latitude and longitude) and the voting patterns across different polling units. The scores represent the degree to which a particular polling unit's results deviate from what might be expected based on broader trends.

  •      Geographical locations was obtained from Geocode extension in google sheet
    
  •      **Data cleaning using Python**
    

I removed the null values from the dataset

- Find Neighbours by radius

To detect outliers, I utilized the geodesic distance measurement to determine the distance between polling units. By considering a radius of 1.0 km, I identified neighboring units located within this range. Subsequently, for each polling unit, I computed the outlier score for each political party by comparing their vote counts with the average vote counts of the neighboring units. This allowed for the identification of potential outliers based on deviations from the surrounding units' voting patterns.![A screenshot of a computer program

Description automatically generated](file:///C:/Users/Basma/AppData/Local/Temp/msohtmlclip1/01/clip_image004.jpg)

4. Calculate Outlier Scores

I performed a for loop iteration over each polling unit to calculate their respective outlier scores, and I stored the results in a DataFrame for further analysis. Subsequently, I sorted the dataset to identify the top outliers. This process allowed me to pinpoint the polling units with the highest deviations from the average voting patterns, highlighting the most significant outliers for each party.

Saving the data

The sorted file with outliers is then saved to excel file

Summary of Findings

Sorted List of Polling Units by Outlier Scores for Each Party

APC: Polling units were sorted based on the 'Outlier_Score_APC', with higher scores indicating more significant deviations.

LP: Sorted by 'Outlier_Score_LP'.

PDP: Sorted by 'Outlier_Score_PDP'.

NNPP: Sorted by 'Outlier_Score_NNPP'.

Detailed Examples of Top 3 Outliers for Each Party

APC:

1- PU-Code: 26-13-02-010 (GBARIGI) with Outlier Score: 1309

2- PU-Code: 26-06-09-004 (KOFAR AUDU GWARI) with Outlier Score: 1172

3- PU-Code: 26-24-10-014 (GOVT. PRY SCH. JIBI) with Outlier Score: 1000

LP:

1-PU-Code: 26-23-07-020 (OPEN SPACE DIKKO GIWA) with Outlier score : 758

2,3: PU-Code: 26-18-03-001 (TSOHON DANGUNG) ans also 26-18-03-011 (UNG DACHI) with Outlier score both of 87.

PDP:

1,2-PU-Code: 26-04-09-016 (UNGUWA KAMBARI) and 26-04-09-017 (TUNGAN ALH. IBRAHIM LETE) with Outlier score:857.

3- PU-Code: 26-16-02-014 (TUNGAN GERO II) with Outlier score : 759

NNPP:

1-PU-Code: 26-18-08-008 (BAKIN KASUWA ZAZZAGA) with Outlier Score: 1352

2,3- PU-Code: 26-04-09-016 (UNGUWA KAMBARI) and PU-Code: 26-04-09-017 (TUNGAN ALH. IBRAHIM LETE) both with Outlier score: 1070

Discussion and feedback(0 comments)
2000 characters remaining
Cookie SettingsWe use cookies to enhance your experience, analyze site traffic and deliver personalized content. Read our Privacy Policy.