---
title: "RESPONDENTS’ PREFERRED SURVEY TOPICS: MEASUREMENT AND PREVALENCE"
subtitle: "Replication Files: Study 3"
author: "Tobias Gummer, Saskia Bartholomäus, and Bernd Weiss"
date: "19.01.2026"
output:
  html_document:
    theme: united
    toc: true
    toc_depth: 4
    toc_float:
      collapsed: true
      smooth_scroll: true
---
# Data Preparation 

The The data set required for replication is provided in the subfolder data.

```{r loading dataset, include=TRUE}
# Loading Dataset
cat("dbd_dta   <- read_dta('[INCLUDE PATH TO THE PRETEST DATA SET HERE]/PrADePSdbdData.dta')")
cat("dbd_dta   <- remove_all_labels(dbd_dta)")
```

```{r renaming variables, message=FALSE, warning=FALSE, results='hide'}
# Renaming Variables
dbd_dta <- dplyr::rename(dbd_dta, 
  tp_well = kzca001a_satis, 
  tp_pol = kzca002a_polit, 
  tp_nature = kzca003a_natur, 
  tp_personal = kzca004a_perso,
  tp_media = kzca005a_socia, 
  tp_work = kzca006a_inwrk, 
  tp_migration = kzca007a_inmig, 
  tp_economy = kzca008a_ineco, 
  tp_leisure = kzca009a_inlei,
  tp_crisis = kzca010a_incri) 
```

```{r creating variable labels, message=FALSE, warning=FALSE, results='hide'}
# Variable Labels
labels <- list(
  tp_pol           = "Topic Interest Politics",
  tp_well          = "Topic Interest Well-Being",
  tp_nature        = "Topic Interest Nature",
  tp_media         = "Topic Interest Media",
  tp_work          = "Topic Interest Work",
  tp_migration     = "Topic Interest Migration",
  tp_economy       = "Topic Interest Economy",
  tp_crisis        = "Topic Interest Crisis",
  tp_personal      = "Topic Interest Personality",
  tp_leisure       = "Topic Interest Leisure")
```

```{r creaing value labels, message=FALSE, warning=FALSE, results='hide'}
# Value Labels
dbd_dta <- set_labels(
  dbd_dta, tp_pol, tp_well, tp_nature, tp_personal, tp_media, tp_work, tp_migration, 
  tp_economy, tp_crisis, tp_leisure, 
  labels = c("very interested" = 7, "not interestes at all" = 1)) 
```

```{r create subset}
# Creating Subsets
subset <- select(dbd_dta, tp_nature, tp_crisis, tp_personal, tp_economy, tp_leisure, tp_well, tp_migration, tp_work, tp_pol, tp_media)
subset[subset == -99] <- NA
subset <- subset[complete.cases(subset), ]
```

```{r save datasets, message=FALSE, warning=FALSE, results='hide'}
# Save Datasets
save(subset, labels, file = "data/subset.RData")
rm(dbd_dta, subset, labels)
```