
Simulated daily diary study: entertainment media use and wellbeing
Source:R/media_diary.R
media_diary.RdA simulated daily diary dataset for illustrating multilevel descriptive statistics with mlstats. The data mimics a study in which 100 participants completed brief daily surveys for 14 consecutive days, reporting their wellbeing, perceived stress, entertainment media use, and enjoyment on that media. Trait self-control was measured once at the beginning of the study.
The dataset is designed to illustrate the difference between within-person and between-person correlations, including a case where the two go in opposite directions (screen_time × wellbeing):
Within persons: on days when someone watches more entertainment media than usual, they report slightly better wellbeing — consistent with short-term escapism or mood repair through media use.
Between persons: people who watch more entertainment media on average tend to report lower average wellbeing — chronic heavy media use is associated with lower wellbeing, partly because it reflects lower trait self-control.
The pooled (naive) correlation between screen_time and wellbeing is near zero, masking both of these real effects.
Format
A data frame with 1,400 rows and 6 columns:
- person
Integer person identifier (1–100).
- self_control
Trait self-control, measured once at study entry (1–7 scale, higher = more self-control). Constant within persons; ICC approximately 1.
- wellbeing
Daily positive wellbeing (1–7 scale, higher = better).
- screen_time
Minutes of entertainment media consumed that day (e.g., television, streaming services; non-negative integer).
- stress
Daily perceived stress (1–7 scale, higher = more stressed).
- enjoyment
How much the person enjoyed the media they watched that day (1–7 scale, higher = more enjoyment).
Source
Simulated data. Generated by data-raw/media_diary.R
using a fixed random seed (set.seed(42)) for reproducibility.
See that script for full simulation details including the intended
within- and between-person correlation structure.
Examples
data("media_diary")
# Quick look at the structure
str(media_diary)
#> tibble [1,400 × 6] (S3: tbl_df/tbl/data.frame)
#> $ person : int [1:1400] 1 1 1 1 1 1 1 1 1 1 ...
#> $ self_control: num [1:1400] 5.1 5.1 5.1 5.1 5.1 5.1 5.1 5.1 5.1 5.1 ...
#> $ wellbeing : num [1:1400] 4.9 5.4 5.8 6.5 5.5 5.9 6.4 5.7 6.5 4.8 ...
#> $ screen_time : num [1:1400] 80 120 98 112 21 84 48 58 39 82 ...
#> $ stress : num [1:1400] 4.1 4 3.4 3.5 2.8 3.2 2.6 2.6 2.4 4 ...
#> $ enjoyment : num [1:1400] 5.7 5.6 5 6.2 4.4 6 5.1 4.5 5.3 5.4 ...
# Number of persons and observations
length(unique(media_diary$person)) # 100 persons
#> [1] 100
nrow(media_diary) # 1,400 diary entries
#> [1] 1400