Skip to content

Shriti507/SurveyCorps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“Š Benford's Law Analysis on Twitter Data

Ever wondered if Twitter metrics like follower counts and user IDs follow a natural pattern? This project explores whether Benfordโ€™s Lawโ€”a fascinating statistical ruleโ€”applies to numerical data from Twitter.

๐Ÿงฎ Benfordโ€™s Law states that in many naturally occurring datasets, lower digits (especially '1') are more likely to appear as the first digit than higher ones (like '9'). This project examines whether Twitter's data aligns with this distribution.


๐Ÿง  Objective

To analyze whether Twitter metricsโ€”such as follower counts, friend counts, and user IDsโ€”follow Benfordโ€™s Law.
This can help in:

  • Detecting anomalies or suspicious patterns
  • Assessing data authenticity
  • Differentiating between organic and manipulated growth

๐Ÿ“‚ Data Source

  • ๐Ÿ”น Mock Twitter Data

Fields analyzed:

  • ๐Ÿ‘ฅ Follower Count
  • ๐Ÿค Friend Count
  • ๐Ÿ†” User ID

๐Ÿ” Methodology

  1. Data Cleaning

    • Removed null, zero, and irrelevant values.
  2. Digit Extraction

    • Extracted the leading digit from each numeric field.
  3. Distribution Comparison

    • Calculated the actual frequency of leading digits
    • Compared with the expected Benford distribution
  4. Statistical Analysis

    • Conducted a Chi-Square Goodness-of-Fit Test
    • Visualized actual vs expected digit frequencies

๐Ÿ“ˆ Features

  • ๐Ÿ“Š Line plots and bar graphs for digit frequencies
  • ๐Ÿ“‰ Visual comparison between actual vs expected Benford distribution
  • ๐Ÿ“Œ Separate analysis for different fields (followers, friends, IDs)
  • ๐Ÿšจ Extendable for anomaly detection

๐Ÿ›  Technologies Used

  • ๐Ÿ Python
  • ๐Ÿ“ฆ Pandas, NumPy
  • ๐Ÿ“Š Matplotlib, Seaborn (visualizations)
  • ๐Ÿ“ SciPy (statistical testing)

๐Ÿ“Œ Use Cases

  • โœ… Data Integrity Checks: Detect metric manipulation or spammy activity
  • ๐Ÿ” Behavioral Insights: Analyze trends in natural vs. inorganic growth
  • ๐ŸŽ“ Educational Tool: Real-world demonstration of Benfordโ€™s Law

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •