Generate a simulated dataset across participants from the
meta-d' model with sensitivity dprime, response bias c, metacognitive
efficiency M, and distances between confidence thresholds c2_0_diff and
c2_1_diff (for the two responses).
Usage
sim_metad_participant(
N_participants = 100,
N_trials = 100,
mean_dprime = 1,
sd_dprime = 0.5,
mean_c = 0,
sd_c = 0.5,
mean_M = 0,
sd_M = 0.5,
mean_z_c2_0 = rep(-1, 3),
sd_z_c2_0 = rep(0.1, 3),
r_z_c2_0 = diag(3),
mean_z_c2_1 = rep(-1, 3),
sd_z_c2_1 = rep(0.1, 3),
r_z_c2_1 = diag(3),
metac_absolute = TRUE,
allow_negative_values = FALSE,
summarize = FALSE,
lcdf = normal_lcdf,
lccdf = normal_lccdf
)Arguments
- N_trials, N_participants
Total number of participants and trials to simulate per participant. Half of these trials will have
stimulus=0and half will havestimulus=1.- mean_dprime, sd_dprime
The mean and standard deviation of sensitivities of the signal detection agents to simulate
- mean_c, sd_c
The mean and standard deviation of response bias of the signal detection agents to simulate
- mean_M, sd_M
The mean and standard deviation of metacognitive efficiency of the agents. If
allow_negative_values==TRUE(default), M-ratio is simulated on the logarithmic scale, where0indicates optimal metacognitive sensitivity, negative numbers indicate metacognitive inefficiency, and positive numbers indicate metacognitive hyper-efficiency. Otherwise, M-ratio is modeled on its natural scale to allow negative values.- mean_z_c2_0, mean_z_c2_1
Mean distance between confidence thresholds for
"0"and"1"responses on the log_scale, such thatmeta_c2_0 = meta_c - cumulative_sum(exp(z_c2_0))andmeta_c2_1 = meta_c + cumulative_sum(exp(z_c2_1)).- sd_z_c2_0, sd_z_c2_1
SD of log distances between confidence thresholds for
"0"and"1"responses on the log_scale.- r_z_c2_0, r_z_c2_1
Correlation of log distances between confidence thresholds for
"0"and"1"responses on the log_scale.- metac_absolute
Determines how to fix the type 1 threshold for modeling confidence ratings. If
metac_absolute=TRUE,meta_c = c. Otherwise,meta_c = M * c.- allow_negative_values
If
allow_negative_values=FALSE(default), M-ratio is simulated using a normal distribution on the logarithmic scale to prohibit negative values. Ifallow_negative_values=TRUE, then M-ratio is simulated on its natural scale, allowing negative values.- summarize
Aggregate the data? If
summarize=FALSE, returns a dataset with one row per observation. Ifsummarize=TRUE, returns an aggregated dataset wherenis the number of observations per response, accuracy, and confidence level.- lcdf
The log cumulative distribution function of the underlying signal distribution. By default, uses a
normal(+/-dprime/2, 1)distribution.- lccdf
The log complement cumulative distribution function of the underlying signal distribution. By default, uses a
normal(+/-dprime/2, 1)distribution.
Value
A simulated dataset of type 1 responses and confidence ratings, with columns:
trial: the simulated trial numberparticipant: the simulated participant numberstimulus: the value of the stimulus on each trial (either0or1)response: the simulated type 1 response (either0or1)correct: whetherstimulus==response(either0or1)confidence: the simulated type 2 response (from1tolength(c2_0_diff)+1)dprime:theta_2: the simulated agent's parameter values
If summarize=TRUE, the trial column is replaced with an n column
indicating the number of simulated type 1/type 2 responses for each
possible value.
Examples
sim_metad_participant(N_participants = 10, N_trials = 10)
#> # A tibble: 100 × 15
#> participant trial stimulus response correct confidence dprime c
#> <int> <int> <int> <int> <int> <int> <dbl> <dbl>
#> 1 1 1 0 0 1 1 0.498 0.304
#> 2 1 2 0 0 1 2 0.498 0.304
#> 3 1 3 0 0 1 2 0.498 0.304
#> 4 1 4 0 0 1 2 0.498 0.304
#> 5 1 5 0 0 1 3 0.498 0.304
#> 6 1 1 1 0 0 1 0.498 0.304
#> 7 1 2 1 0 0 4 0.498 0.304
#> 8 1 3 1 1 1 1 0.498 0.304
#> 9 1 4 1 1 1 2 0.498 0.304
#> 10 1 5 1 1 1 4 0.498 0.304
#> # ℹ 90 more rows
#> # ℹ 7 more variables: meta_dprime <dbl>, M <dbl>, meta_c2_0 <list>,
#> # meta_c2_1 <list>, theta <dbl>, theta_1 <dbl>, theta_2 <dbl>
sim_metad_participant(N_participants = 25, mean_dprime = 2, mean_M = -1)
#> # A tibble: 2,500 × 15
#> participant trial stimulus response correct confidence dprime c
#> <int> <int> <int> <int> <int> <int> <dbl> <dbl>
#> 1 1 1 0 0 1 1 2.16 -0.556
#> 2 1 2 0 0 1 1 2.16 -0.556
#> 3 1 3 0 0 1 1 2.16 -0.556
#> 4 1 4 0 0 1 1 2.16 -0.556
#> 5 1 5 0 0 1 1 2.16 -0.556
#> 6 1 6 0 0 1 1 2.16 -0.556
#> 7 1 7 0 0 1 2 2.16 -0.556
#> 8 1 8 0 0 1 2 2.16 -0.556
#> 9 1 9 0 0 1 2 2.16 -0.556
#> 10 1 10 0 0 1 2 2.16 -0.556
#> # ℹ 2,490 more rows
#> # ℹ 7 more variables: meta_dprime <dbl>, M <dbl>, meta_c2_0 <list>,
#> # meta_c2_1 <list>, theta <dbl>, theta_1 <dbl>, theta_2 <dbl>