Skip to contents

Fitting the meta-d’ model

Run the meta-d’ model on aggregated or non-aggregated data using brms

fit_metad()
Fit the meta-d' model using brms package
metad()
brms family for the metad' model
metac2_parameters()
Obtain a vector of the names of the K-1 parameters representing the differences between successive confidence criteria for the meta-d' model with K levels of confidence.
stanvars_metad()
Generate Stan code for the meta-d' model

Processing data for model fitting

Transform data between common formats used in metacognition research

to_signed() to_unsigned()
Convert binary variable \(x\) between \(\{0, 1\}\) and \(\{-1, 1\}\)
joint_response() type1_response() type2_response()
Convert between separate and joint type 1/type 2 responses
aggregate_metad()
Aggregate data by response, confidence, and other columns
type1_probabilities()
Calculate empirical type 1 response probabilities
type2_probabilities()
Calculate empirical type 2 response probabilities
joint_probabilities()
Calculate empirical joint type 1/type 2 response probabilities
roc1()
Calculate empirical pseudo-type 1 receiver operating characteristic curves
roc2()
Calculate empirical type 2 receiver operating characteristic curve
auroc1()
Calculate area under the empirical pseudo-type 1 receiver operating characteristic curve
auroc2()
Calculate the area under empirical type 2 receiver operating characteristic curves
mean_confidence()
Calculate empirical mean confidence

Extracting model estimates

Obtain model parameters, posterior expectations, and implied quantities from fitted models.

linpred_draws_metad() add_linpred_draws_metad() linpred_rvars_metad() add_linpred_rvars_metad()
Obtain posterior draws of meta-d' model parameters
epred_draws_metad() add_epred_draws_metad() epred_rvars_metad() add_epred_rvars_metad()
Obtain posterior draws of joint response probabilities
predicted_draws_metad() add_predicted_draws_metad() predicted_rvars_metad() add_predicted_rvars_metad()
Obtain posterior predictions of joint responses
mean_confidence_draws() add_mean_confidence_draws() mean_confidence_rvars() add_mean_confidence_rvars()
Obtain posterior draws of mean confidence
metacognitive_bias_draws() add_metacognitive_bias_draws() metacognitive_bias_rvars() add_metacognitive_bias_rvars()
Obtain posterior draws of an index of metacognitive bias
type1_draws() add_type1_draws() type1_rvars() add_type1_rvars()
Calculate posterior draws of type 1 response probabilities
type2_draws() add_type2_draws() type2_rvars() add_type2_rvars()
Calculate posterior draws of type 2 response probabilities
roc1_draws() add_roc1_draws() roc1_rvars() add_roc1_rvars()
Obtain posterior draws of the pseudo type 1 receiver operating characteristic (ROC) curve.
roc2_draws() add_roc2_draws() roc2_rvars() add_roc2_rvars()
Obtain posterior draws of the response-specific type 2 receiver operating characteristic (ROC) curves.
auroc1_draws() add_auroc1_draws() auroc1_rvars() add_auroc1_rvars()
Obtain posterior draws of the area under the pseudo type 1 receiver operating characteristic (ROC) curve.
auroc2_draws() add_auroc2_draws() auroc2_rvars() add_auroc2_rvars()
Obtain posterior draws of the area under the type 2 receiver operating characteristic (ROC) curve.

Simulating from the meta-d’ model

Generate simulated type 1 responses and confidence ratings from the meta-d’ model

sim_metad()
Simulate from the meta-d' model
sim_metad_condition()
Simulate from the meta-d' model across separate conditions
sim_metad_participant()
Simulate from the hierarchical meta-d' model
sim_metad_participant_condition()
Simulate from the hierarchical meta-d' model across within-participant conditions

Working with common distributions

Calculate model log likelihood, response probabilities, or sample from distributions

normal_lcdf() normal_lccdf()
Normal cumulative distribution functions
metad_pmf()
Generate (log) probability simplex over the joint type 1/type 2 responses
cov_matrix()
Generate a covariance matrix.
cor_matrix()
Generate a correlation matrix with all off-diagonal values equal to r
rmatrixnorm()
Sample from a matrix-normal distribution

Example data and model

Inspect an example dataset and fitted meta-d’ model

example_data()
Simulated data for example model fitting
example_model()
Example meta-d' model for model post-processing