
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 were asked to complete a brief daily survey for up to 14 consecutive days, reporting their wellbeing, perceived stress, entertainment media use, and enjoyment on that media. As in most real mobile diary studies, not everyone completes every day: the number of completed surveys per person is itself simulated (ranging from 5 to 14, median 12) to illustrate realistic, unequal group sizes. 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 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,184 rows and 6 columns:
- person
Integer person identifier (1–100). Each person contributes between 5 and 14 rows (diary days), simulating non-response; see
data-raw/media_diary.R.- 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,184 × 6] (S3: tbl_df/tbl/data.frame)
#> $ person : int [1:1184] 1 1 1 1 1 1 1 1 1 1 ...
#> $ self_control: num [1:1184] 5 5 5 5 5 5 5 5 5 5 ...
#> $ wellbeing : num [1:1184] 3.5 4 3.4 3.7 3.9 4.3 5.3 3.5 3.1 3.9 ...
#> $ screen_time : num [1:1184] 83 82 103 105 68 143 139 105 75 55 ...
#> $ stress : num [1:1184] 3.9 4.4 4.8 4.7 3.6 5.3 2.9 4.7 3.7 2.6 ...
#> $ enjoyment : num [1:1184] 4.5 3.9 3.8 4.6 3.7 5 5.4 4.2 3.9 3.8 ...
# Number of persons and observations
length(unique(media_diary$person)) # 100 persons
#> [1] 100
nrow(media_diary) # 1,184 diary entries (5-14 per person)
#> [1] 1184