classification {RprobitB} | R Documentation |
Classify deciders preference-based
Description
This function classifies the deciders based on their allocation to the components of the mixing distribution.
Usage
classification(x, add_true = FALSE)
Arguments
x |
An object of class |
add_true |
Set to |
Details
The function can only be used if the model has at least one random effect
(i.e. P_r >= 1
) and at least two latent classes (i.e. C >= 2
).
In that case, let denote the class allocations
of the
deciders based on their estimated mixed coefficients
.
Independently for each decider
, the conditional probability
of having
allocated to class
for
depends on the class
allocation vector
, the class means
and the class
covariance matrices
and is proportional to
This function displays the relative frequencies of which each decider was allocated to the classes during the Gibbs sampling. Only the thinned samples after the burn-in period are considered.
Value
A data frame. The row names are the decider ids. The first C
columns
contain the relative frequencies with which the deciders are allocated to
the C
classes. Next, the column est
contains the estimated
class of the decider based on the highest allocation frequency. If
add_true
, the next column true
contains the true class
memberships.
See Also
update_z()
for the updating function of the class allocation vector.