Z_identities {samplr} | R Documentation |
Z Identities
Description
Calculates identities Z1 to Z18 as defined in (Costello and Watts 2016; Zhu et al. 2020). Probability theory predicts that these will all equal 0.
Usage
Z_identities(
a = NULL,
b = NULL,
a_and_b = NULL,
a_or_b = NULL,
a_given_b = NULL,
b_given_a = NULL,
a_given_not_b = NULL,
b_given_not_a = NULL,
a_and_not_b = NULL,
b_and_not_a = NULL,
not_a = NULL,
not_b = NULL
)
Arguments
a , b , a_and_b , a_or_b , a_given_b , b_given_a , a_given_not_b , b_given_not_a , a_and_not_b , b_and_not_a |
Probability estimates given by participants |
not_a , not_b |
Probability estimates given by participants. If not given, they'll default to 1-a and 1-b respectively |
Details
If some of the probability estimates are not given, calculation will proceed and equalities that cannot be calculated will be coded as NA.
Value
Dataframe with identities Z1 to Z18
References
Costello F, Watts P (2016).
“People's Conditional Probability Judgments Follow Probability Theory (plus Noise).”
Cognitive Psychology, 89, 106–133.
doi:10.1016/j.cogpsych.2016.06.006.
Zhu J, Sanborn AN, Chater N (2020).
“The Bayesian Sampler: Generic Bayesian Inference Causes Incoherence in Human Probability Judgments.”
Psychological Review, 127(5), 719–748.
doi:10.1037/rev0000190.
Examples
Z_identities(
a=.5,
b=.1,
a_and_b=.05,
a_or_b=.55,
a_given_b=.5,
b_given_a=.1,
a_given_not_b=.5,
b_given_not_a=.1,
a_and_not_b=.45,
b_and_not_a=.05,
)
#Get identities for a set of participants
library(magrittr)
library(dplyr)
library(tidyr)
data.frame(
ID = LETTERS[1:20],
a=runif(20),
b=runif(20),
a_and_b=runif(20),
a_or_b=runif(20),
a_given_b=runif(20),
b_given_a=runif(20),
a_given_not_b=runif(20),
b_given_not_a=runif(20),
a_and_not_b=runif(20),
b_and_not_a=runif(20),
not_a=runif(20),
not_b=runif(20)
) %>%
group_by(ID) %>%
do(
Z_identities(
.$a,
.$b,
.$a_and_b,
.$a_or_b,
.$a_given_b,
.$b_given_a,
.$a_given_not_b,
.$b_given_not_a,
.$a_and_not_b,
.$b_and_not_a,
.$not_a,
.$not_b
)
)