2023-07-03 14:28:28 +02:00
|
|
|
---
|
2023-07-03 18:44:45 +02:00
|
|
|
title: "Reliability of SAM threat and challenge and COPE"
|
2023-07-03 14:28:28 +02:00
|
|
|
output: html_notebook
|
|
|
|
---
|
|
|
|
|
|
|
|
|
2023-07-03 18:44:45 +02:00
|
|
|
```{r libraries, message=FALSE, warning=FALSE, include=FALSE, cache=FALSE}
|
|
|
|
library(conflicted)
|
|
|
|
library(here)
|
|
|
|
library(tidyverse)
|
|
|
|
library(magrittr)
|
|
|
|
library(kableExtra)
|
|
|
|
|
|
|
|
conflicts_prefer(
|
|
|
|
readr::col_factor,
|
|
|
|
purrr::discard,
|
|
|
|
dplyr::filter,
|
|
|
|
dplyr::lag,
|
|
|
|
purrr::set_names,
|
|
|
|
tidyr::extract,
|
|
|
|
kableExtra::group_rows
|
|
|
|
)
|
2023-07-03 14:28:28 +02:00
|
|
|
```
|
|
|
|
|
2023-07-03 18:44:45 +02:00
|
|
|
```{r style, include=FALSE, cache=FALSE}
|
|
|
|
styler::style_file(
|
|
|
|
here("statistical_analysis", "scale_reliability.Rmd"),
|
|
|
|
scope = "tokens",
|
|
|
|
indent_by = 4L
|
|
|
|
)
|
2023-07-03 14:28:28 +02:00
|
|
|
```
|
|
|
|
|
2023-07-03 18:44:45 +02:00
|
|
|
|
|
|
|
```{r read_data}
|
|
|
|
COL_TYPES <- cols(
|
|
|
|
.default = col_double(),
|
|
|
|
participant_id = col_factor(),
|
|
|
|
username = col_factor(),
|
|
|
|
device_id = col_factor(),
|
|
|
|
esm_trigger = col_factor(),
|
|
|
|
double_esm_user_answer_timestamp = col_double(),
|
|
|
|
datetime_lj = col_datetime(format = ""),
|
|
|
|
date_lj = col_date(format = ""),
|
|
|
|
time = col_factor(),
|
|
|
|
esm_user_answer = col_factor()
|
|
|
|
)
|
|
|
|
df_SAM <- read_csv(here("data", "raw", "df_esm_SAM_threat_challenge.csv"), col_types = COL_TYPES)
|
|
|
|
df_COPE <- read_csv(here("data", "raw", "df_esm_COPE.csv"), col_types = COL_TYPES)
|
|
|
|
```
|