Learn R Programming

mariposa (version 0.7.3)

survey_data: Social Survey Data (Synthetic)

Description

A synthetic dataset modeled after large-scale social surveys with demographics, attitudes, and survey design features. Created for testing and demonstration purposes without licensing concerns.

Usage

survey_data

Arguments

Format

A data frame with 2,500 rows and 16 variables:

id

Unique identifier (1-2500)

age

Age in years (18-95)

gender

Gender (Male, Female)

region

Region (East, West)

education

Education level (Basic Secondary, Intermediate Secondary, Academic Secondary, University)

income

Monthly household income in EUR (800-15000)

employment

Employment status (Student, Employed, Unemployed, Retired, Other)

political_orientation

Political orientation (1=very left to 5=very right)

environmental_concern

Environmental concern (1=not concerned to 5=very concerned)

life_satisfaction

Life satisfaction (1=very dissatisfied to 5=very satisfied)

trust_government

Trust in government (1=no trust to 5=complete trust)

trust_media

Trust in media (1=no trust to 5=complete trust)

trust_science

Trust in science (1=no trust to 5=complete trust)

sampling_weight

Post-stratification sampling weight (0.7-1.4)

stratum

Stratification variable combining region and age group

interview_mode

Interview mode (Face-to-face, Telephone, Online)

Details

This dataset contains realistic patterns of correlation between variables:

  • Education correlates with income and political attitudes

  • Regional differences reflect East/West patterns

  • Age effects on employment and attitudes

  • Realistic missing data patterns (3-12% depending on sensitivity)

  • Survey weights for post-stratification adjustment

The data includes proper variable labels and follows social survey conventions for coding and structure. Generated with set.seed(2024) for reproducibility.

See Also

describe for descriptive statistics of numeric variables.

frequency for categorical frequency tables.

t_test for group comparisons.

Examples

Run this code
# Load required packages and data
library(dplyr)
data(survey_data)

# Basic descriptive statistics
survey_data %>% describe(age, income, weights = sampling_weight)

# Frequency analysis
survey_data %>% frequency(education, region, weights = sampling_weight)

# Group comparisons
survey_data %>%
  group_by(region) %>%
  t_test(life_satisfaction, group = gender, weights = sampling_weight)

Run the code above in your browser using DataLab