% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hmetad.R
\name{response_probabilities}
\alias{response_probabilities}
\title{Compute joint response probabilities from aggregated counts}
\usage{
response_probabilities(counts)
}
\arguments{
\item{counts}{A vector (or matrix) of counts of joint type 1/type 2
responses as provided by \link{aggregate_metad}}
}
\value{
A vector (or matrix) of response probabilities \eqn{P(R, C \;\vert\; S)}
}
\description{
Compute joint response probabilities from aggregated counts
}
\details{
For response \eqn{R}, confidence \eqn{C}, stimulus \eqn{S}, and number of
confidence levels \eqn{K}, \code{counts} should be a vector (or matrix with rows)
of the form:
\deqn{
 [N_{S=0, R=0, C=K}, \ldots, N_{S=0, R=0, C=1}, \\
 N_{S=0, R=1, C=1}, \ldots, N_{S=0, R=1, C=K}, \\
 N_{S=1, R=0, C=K}, \ldots, N_{S=1, R=0, C=1}, \\
 N_{S=1, R=1, C=1}, \ldots, N_{S=1, R=1, C=K}] \\
}{
[N(R=0, C=K, S=0), ..., N(R=0, C=1, S=0),
 N(R=1, C=1, S=0), ..., N(R=1, C=K, S=0),
 N(R=0, C=K, S=1), ..., N(R=0, C=1, S=1),
 N(R=1, C=1, S=1), ..., N(R=1, C=K, S=1)]
}

Returns a vector (or matrix with rows) of the form:
\deqn{
[P(R=0, C=K \;\vert\; S=0), ..., P(R=0, C=1 \;\vert\; S=0), \\
 P(R=1, C=1 \;\vert\; S=0), ..., P(R=1, C=K \;\vert\; S=0), \\
 P(R=0, C=K \;\vert\; S=1), ..., P(R=0, C=1 \;\vert\; S=1), \\
 P(R=1, C=1 \;\vert\; S=1), ..., P(R=1, C=K \;\vert\; S=1)]
}{
[P(R=0, C=K | S=0), ..., P(R=0, C=1 | S=0),
 P(R=1, C=1 | S=0), ..., P(R=1, C=K | S=0),
 P(R=0, C=K | S=1), ..., P(R=0, C=1 | S=1),
 P(R=1, C=1 | S=1), ..., P(R=1, C=K | S=1)]
}
}
\examples{
# Aggregate responses from simulated data
d <- sim_metad() |> aggregate_metad()

# Compute conditional response probabilities
response_probabilities(d$N)

# Also works on matrices
matrix(rep(1, 16), nrow = 2) |> response_probabilities()
}
