Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Survey Data Analysis in R

Language: R Method: Survey Analysis Framework: tidyverse License: MIT

Overview

This repository provides a reproducible R workflow for cleaning, weighting, and analyzing survey data. It covers the full pipeline from raw survey exports to publication-ready descriptive tables and visualizations — with a focus on Likert scale items, ordinal variables, and demographic breakdowns commonly used in communication and social science research.


🔗 Related Projects

Repository Description
🦠 facebook-reactions-covid19-india PhD thesis project
⏱️ timeseries-facebook-engagement-r Time-series toolkit
🧠 stm-social-media-r STM topic modeling
💬 sentiment-lexicon-comparison Sentiment lexicon comparison
📊 meta-content-analysis Meta platform analysis
🗳️ reddit-political-misinfo-coding Reddit coding project
🔄 cross-platform-engagement-analysis Cross-platform framework
🔴 disinformation-detection-ml ML disinformation classifier
🟣 nlp-news-classification-r NLP news classification
🟢 crowdtangle-meta-api-workflow Data collection pipeline
📝 survey-scale-validation-r Scale validation: EFA/CFA, reliability
🧪 survey-experiment-analysis-r Survey experiment & vignette analysis

Research Objectives

  • Import and clean raw survey data exported from Qualtrics, SurveyMonkey, or similar tools
  • Handle missing data, recoding, and variable labelling
  • Analyze Likert scale items and ordinal responses
  • Produce weighted and unweighted descriptive statistics
  • Create publication-ready tables and visualizations by demographic group

Workflow Overview

Step Script Description
1 01_import_clean.R Import raw CSV, rename variables, recode values
2 02_missing_data.R Inspect and handle missing values (listwise, imputation)
3 03_likert_analysis.R Summarize and visualize Likert scale items
4 04_descriptive_stats.R Frequency tables, means, medians by group
5 05_weighting.R Apply survey weights using survey package
6 06_visualization.R Diverging bar charts, grouped plots, demographic breakdowns

Repository Structure

survey-data-analysis-r/
├── scripts/
│   ├── 01_import_clean.R
│   ├── 02_missing_data.R
│   ├── 03_likert_analysis.R
│   ├── 04_descriptive_stats.R
│   ├── 05_weighting.R
│   └── 06_visualization.R
├── data/
│   └── README.md
├── output/
│   ├── figures/
│   └── tables/
├── .gitignore
├── README.md
└── LICENSE

Required Data Format

Column Type Description
respondent_id str Unique respondent ID
Q1 ... Qn int/str Survey item responses
age, gender, education str/int Demographic variables
weight num Survey weight (optional)

Requirements

install.packages(c(
  "tidyverse", "haven", "janitor", "labelled",
  "survey", "srvyr", "likert", "ggplot2", "scales",
  "gt", "gtsummary", "naniar"
))

Key Packages

Package Purpose
haven Import Stata, SPSS, SAS files
labelled Variable and value labels
janitor Data cleaning utilities
survey / srvyr Survey-weighted analysis
likert Likert scale visualization
naniar Missing data visualization
gtsummary Publication-ready tables

Author

Sawood Anwar — PhD in Humanities (Text and Communication Sciences), University of Urbino Carlo Bo Defended: 22 September 2025 | Supervisor: Prof. Fabio Giglietto


License

MIT License. See LICENSE.

Keywords: Survey Data Analysis, Likert Scale, R, tidyverse, gtsummary, Survey Weights, Descriptive Statistics, Computational Communication, Social Science Methods

About

Reproducible R workflow for cleaning, weighting, and analyzing survey data: Likert scales, ordinal variables, and demographic breakdowns

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages